Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: refactor and export scope terms #882

Merged
merged 19 commits into from
Jun 24, 2020
Merged
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 39 additions & 46 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<body data-cite="ENCODING SCREEN-ORIENTATION">
<section id='abstract'>
<p>
This specification defines a JSON-based manifest file that provides
This specification defines a JSON-based file format that provides
developers with a centralized place to put metadata associated with a
web application. This metadata includes, but is not limited to, the web
application's name, links to icons, as well as the preferred URL to
Expand Down Expand Up @@ -437,11 +437,10 @@ <h2>
Navigation scope
</h2>
<p data-link-for="WebAppManifest">
A <dfn data-export="">navigation scope</dfn> is a <a>URL</a> that
represents the set of URLs to which an <a>application context</a> can
be navigated while the manifest is <a>applied</a>. The <a>navigation
scope</a> of a manifest <var>manifest</var> is
<var>manifest</var>["<a>scope</a>"].
The <dfn data-export="">navigation scope</dfn> is the
{{WebAppManifest/scope}} member of a [=processed manifest=]. The
navigation scope restricts the set of URLs to which an [=application
context=] can be [=navigated=] while the manifest is [=applied=].
</p>
<div class="note" data-link-for="WebAppManifest">
<p>
Expand All @@ -460,31 +459,28 @@ <h2>
</p>
</div>
<p>
A <a>URL</a> <var>target</var> is said to be <dfn>within scope</dfn> of
<a>navigation scope</a> <var>scope</var> if the following algorithm
returns <code>true</code>:
A [=URL=] |target:URL| is said to be <dfn data-dfn-for="URL"
data-export="">within scope</dfn> of [=URL=] |scope:URL| if the
following algorithm returns `true`:
</p>
<ol>
<li>Let <var>scopePath</var> be the [=string/concatenation=] of
<var>scopes</var>'s <a data-cite="URL#concept-url-path">path</a>, using
U+002F (/).
<ol class="algorithm">
<li>If |target| and |scope| are not [=same origin=], return `false`.
</li>
<li>Let <var>targetPath</var> be the [=string/concatenation=] of <var>
target</var>'s <a data-cite="URL#concept-url-path">path</a>, using
U+002F (/).
<li>Let |scopePath:string| be the [=string/concatenation=] of
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
|scopes|'s [=URL/path=] using U+002F (/) as the separator.
</li>
<li>If <var>target</var> is <a>same origin</a> as <var>scope</var> and
<var>targetPath</var> starts with <var>scopePath</var>, return
<code>true</code>.
<li>Let |targetPath:string| be the [=string/concatenation=] of
|target|'s [=URL/path=] using U+002F (/) as the separator.
</li>
<li>Otherwise, return <code>false</code>.
<li>Return a [=boolean=] indicating whether |targetPath| starts with
|scopePath:string|.
</li>
</ol>
<p>
A <a>URL</a> <var>target</var> is said to be <dfn data-lt=
"within-scope-manifest">within scope of a manifest</dfn>
<var>manifest</var> if <var>target</var> is <a>within scope</a> of the
navigation scope of <var>manifest</var>.
A [=URL=] |target:URL| is <dfn data-export="">within scope of a
manifest</dfn> if the |target| is [=URL/within scope=] of the
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
[=navigation scope=] (i.e., [=URL/within scope=] of the
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
{{WebAppManifest/scope}} member).
</p>
<div class="note" title="Scope is a simple string match">
The URL string matching in this algorithm is prefix-based rather than
Expand All @@ -496,21 +492,19 @@ <h2>
unexpected behavior, use a scope ending in a <code>/</code>.
</div>
<p>
If the <a>application context</a>'s <a>active document</a>'s
[=Document/URL=] is not <a data-lt="within-scope-manifest">within
scope</a> of the <a>application context</a>'s manifest, the user agent
SHOULD show a prominent UI element indicating the [=Document/URL=] or
at least its <a>origin</a>, including whether it is served over a
secure connection. This UI SHOULD differ from any UI used when the
[=Document/URL=] is <a>within scope</a>, in order to make it obvious
that the user is navigating off scope.
If the [=application context=]'s [=active document=]'s [=Document/URL=]
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
is not [=within scope of a manifest=], the user agent SHOULD show a
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
prominent UI element indicating the [=Document/URL=] or at least its
[=origin=], including whether it is served over a secure connection.
This UI SHOULD differ from any UI used when the [=Document/URL=] is
[=within scope of a manifest=], in order to make it obvious that the
user is navigating off scope.
</p>
<div class="note">
<p>
Nothing prevents an <a>application context</a> from navigating to a
<a>URL</a> that is outside of the application's <a>navigation
scope</a>, while still having the <a>manifest</a> <a>applied</a> to
it.
<a>URL</a> that is outside of the application's [=navigation scope=],
while still having the <a>manifest</a> <a>applied</a> to it.
</p>
<p>
Unlike previous versions of this specification, user agents are no
Expand Down Expand Up @@ -549,9 +543,8 @@ <h3>
Deep links
</h3>
<p>
A <dfn>deep link</dfn> is a URL that is <a data-lt=
"within-scope-manifest">within scope</a> of an <a>installed web
application</a>'s manifest.
A <dfn>deep link</dfn> is a URL that is [=within scope of a
manifest=].
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
</p>
<p>
An <a>application context</a> can be instantiated through a <a>deep
Expand Down Expand Up @@ -1282,8 +1275,7 @@ <h2>
</pre>
<p>
A <dfn data-export="" data-dfn-for="">manifest</dfn> is a JSON document
that contains startup parameters and application defaults for when a
web application is launched.
that is structured as defined by this specification.
</p>
<p>
Every manifest has an associated <dfn>manifest URL</dfn>, which is the
Expand Down Expand Up @@ -1491,11 +1483,12 @@ <h3>
</li>
</ul>
</li>
<li>If <var>start URL</var> is not <a>within scope</a> of scope URL:
<li>If <var>start URL</var> is not [=URL/within scope=] of |scope
URL|:
<ol>
<li>
<a>Issue a developer warning</a> that the start URL is not
<a>within scope</a> of the scope URL.
[=URL/within scope=] of the |scope URL|.
</li>
<li>Return <var>default</var>.
</li>
Expand Down Expand Up @@ -1992,7 +1985,7 @@ <h3>
URL</var> as the base URL. If the result is failure, <a>issue a
developer warning</a> and [=iteration/continue=].
</li>
<li>If <var>shortcut</var>["url"] is not <a>within scope</a> of
<li>If <var>shortcut</var>["url"] is not [=URL/within scope=] of
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
<var>manifest URL</var>, <a>issue a developer warning</a> and
[=iteration/continue=].
</li>
Expand Down Expand Up @@ -2498,9 +2491,9 @@ <h3>
<code>url</code> member
</h3>
<p>
The <dfn>url</dfn> member of a <a>ShortcutItem</a> is the <a>URL</a>
<a data-lt="within scope of a manifest">within the application's
scope</a> that opens when the associated shortcut is activated.
The <dfn>url</dfn> member of a <a>ShortcutItem</a> is a URL [=within
scope of a manifest=] that opens when the associated shortcut is
activated.
</p>
</section>
<section data-dfn-for="ShortcutItem" data-link-for="ShortcutItem">
Expand Down