You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li>Let <var>p</var> be a <ahref="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects">promise</a>.</li>
622
623
<li>Let <var>client</var> be the <ahref="https://dom.spec.whatwg.org/#context-object">context object</a>'s <ahref="#dfn-service-worker-container-interface-client">service worker client</a>.</li>
623
-
<li>If<var>client</var>is not a <ahref="https://w3c.github.io/webappsec-secure-contexts/#secure-context">secure context</a>, reject <var>p</var> with a "<code><ahref="http://heycam.github.io/webidl/#securityerror">SecurityError</a></code>" exception and abort these steps.</li>
624
+
<li>Let<var>scopeURL</var>be <var>options</var>.</var>scope</var>, or null if <var>options</var>.<var>scope</var> is <ahref="http://heycam.github.io/webidl/#dfn-present">not present</a>.</li>
624
625
<li>Let <var>scriptURL</var> be the result of <ahref="https://url.spec.whatwg.org/#concept-url-parser">parsing</a><var>scriptURL</var> with <ahref="https://html.spec.whatwg.org/multipage/webappapis.html#entry-settings-object">entry settings object</a>'s <ahref="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url">API base URL</a>.</li>
625
-
<li>If <var>scriptURL</var> is failure, reject <var>p</var> with a <code>TypeError</code> and abort these steps.</li>
626
-
<li>If <var>scriptURL</var>'s <ahref="https://url.spec.whatwg.org/#concept-url-scheme">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", reject <var>p</var> with a <code>TypeError</code> and abort these steps.</li>
627
-
<li>If any of the strings in <var>scriptURL</var>'s <ahref="https://url.spec.whatwg.org/#concept-url-path">path</a> contains either <ahref="https://encoding.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> "<code>%2f</code>" or <ahref="https://encoding.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> "<code>%5c</code>", reject <var>p</var> with a <code>TypeError</code> and abort these steps.</li>
628
-
<li>Let <var>scopeURL</var> be null.</li>
629
-
<li>If <var>options</var>.<var>scope</var> is <ahref="http://heycam.github.io/webidl/#dfn-present">not present</a>, set <var>scopeURL</var> to the result of <ahref="https://url.spec.whatwg.org/#concept-url-parser">parsing</a> a string "<code>./</code>" with <var>scriptURL</var>.
630
-
<pclass="note">The scope url for the registration is set to the location of the service worker script by default.</p>
631
-
</li>
632
-
<li>Else, set <var>scopeURL</var> to the result of <ahref="https://url.spec.whatwg.org/#concept-url-parser">parsing</a><var>options</var>.<var>scope</var> with <ahref="https://html.spec.whatwg.org/multipage/webappapis.html#entry-settings-object">entry settings object</a>'s <ahref="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url">API base URL</a>.</li>
633
-
<li>If <var>scopeURL</var> is failure, reject <var>p</var> with a <code>TypeError</code> and abort these steps.</li>
634
-
<li>If <var>scopeURL</var>'s <ahref="https://url.spec.whatwg.org/#concept-url-scheme">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", reject <var>p</var> with a <code>TypeError</code> and abort these steps.</li>
635
-
<li>If any of the strings in <var>scopeURL</var>'s <ahref="https://url.spec.whatwg.org/#concept-url-path">path</a> contains either <ahref="https://encoding.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> "<code>%2f</code>" or <ahref="https://encoding.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> "<code>%5c</code>", reject <var>p</var> with a <code>TypeError</code> and abort these steps.</li>
636
-
<li>Let <var>job</var> be the result of running <ahref="#create-job-algorithm">Create Job</a> with <em>register</em>, <var>scopeURL</var>, <var>scriptURL</var>, <var>p</var>, and <var>client</var>.</li>
637
-
<li>Run the following substep <ahref="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>:
638
-
<ol>
639
-
<li>Invoke <ahref="#schedule-job-algorithm">Schedule Job</a> with <var>job</var>.</li>
640
-
</ol>
641
-
</li>
626
+
<li>Invoke <ahref="#start-register-algorithm">Start Register</a> with <var>scopeURL</var>, <var>scriptURL</var>, <var>p</var>, and <var>client</var>.</li>
642
627
<li>Return <var>p</var>.</li>
643
628
</ol>
644
629
</spec-algorithm>
@@ -1671,6 +1656,59 @@ <h1>Events</h1>
1671
1656
</spec-section>
1672
1657
</spec-clause>
1673
1658
1659
+
<spec-clauseid="link-type-serviceworker">
1660
+
<h1>Link type "<code>serviceworker</code>"</h1>
1661
+
<p>The <dfnid="dfn-link-type-serviceworker">serviceworker</dfn> keyword may be used with <ahref="https://html.spec.whatwg.org/multipage/semantics.html#the-link-element">link</a> elements. This keyword creates an <ahref="https://html.spec.whatwg.org/multipage/semantics.html#external-resource-link">external resource link</a> (<dfnid="dfn-serviceworker-link">serviceworker link</dfn>) that is used to declare a <ahref="#dfn-service-worker-registration">service worker registration</a> and its <ahref="#dfn-scope-url">scope url</a>.</p>
1662
+
1663
+
<spec-sectionid="link-element-processing">
1664
+
<h1>Processing</h1>
1665
+
1666
+
<p>When a user agent that supports [<ahref="https://tools.ietf.org/html/rfc5988">RFC5988</a>] processes a <code>Link</code> header that contains a <ahref="#dfn-serviceworker-link">serviceworker link</a>, the user agent <emclass="rfc2119" title="SHOULD">should</em> run these steps or their <ahref="#dfn-processing-equivalence">equivalent</a>:</p>
1667
+
1668
+
<spec-algorithm>
1669
+
<ol>
1670
+
<li>If the origin of the <ahref="https://tools.ietf.org/html/rfc5988#section-5.2">context IRI</a> of the <code>Link</code> header is not <ahref="https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy">potentially trustworthy</a>, abort these steps.</li>
1671
+
<li>Let <var>scriptURL</var> be the result of <ahref="https://url.spec.whatwg.org/#concept-url-parser">parsing</a> the <ahref="https://tools.ietf.org/html/rfc5988#section-5.1">target IRI</a> of the <code>Link</code> header.</li>
1672
+
<li>Let <var>scopeURL</var> be the <ahref="link-scope-attribute">scope</a><ahref="https://tools.ietf.org/html/rfc5988#section-5.4">target attribute</a> of the <code>Link</code> header, or null if no such attribute is present.</li>
1673
+
<li>Invoke <ahref="#start-register-algorithm">Start Register</a> with <var>scopeURL</var>, <var>scriptURL</var>, a new <ahref="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects">promise</a>, and null.</li>
1674
+
</ol>
1675
+
</spec-algorithm>
1676
+
1677
+
<p>When a <ahref="#dfn-serviceworker-link">serviceworker link</a>'s <ahref="https://html.spec.whatwg.org/multipage/semantics.html#the-link-element">link</a> element is inserted into a document, the user agent <emclass="rfc2119" title="SHOULD">should</em> run these steps or their <ahref="#dfn-processing-equivalence">equivalent</a>:</p>
1678
+
1679
+
<spec-algorithm>
1680
+
<ol>
1681
+
<li>If the <ahref="https://html.spec.whatwg.org/multipage/semantics.html#attr-link-href">href</a> attribute is the empty string, abort these steps.</li>
1682
+
<li>Let <var>client</var> be the document's <ahref="#dfn-service-worker-container-interface-client">service worker client</a>.</li>
1683
+
<li>Let <var>scriptURL</var> be the result of <ahref="https://url.spec.whatwg.org/#concept-url-parser">parsing</a> the <ahref="https://html.spec.whatwg.org/multipage/semantics.html#attr-link-href">href</a> attribute with document's <ahref="https://html.spec.whatwg.org/multipage/infrastructure.html#document-base-url">document base URL</a>.</li>
1684
+
<li>Let <var>scopeURL</var> be the <ahref="link-scope-attribute">scope</a> attribute, or null if the <ahref="link-scope-attribute">scope</a> attribute is omitted.</li>
1685
+
<li>Invoke <ahref="#start-register-algorithm">Start Register</a> with <var>scopeURL</var>, <var>scriptURL</var>, a new <ahref="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects">promise</a>, and <var>client</var>.</li>
1686
+
</ol>
1687
+
</spec-algorithm>
1688
+
1689
+
<p>The <ahref="#dfn-serviceworker-link">serviceworker link</a> element <emclass="rfc2119" title="MUST NOT">must not</em><ahref="https://html.spec.whatwg.org/multipage/syntax.html#delay-the-load-event">delay the load event</a> of the element's <ahref="https://dom.spec.whatwg.org/#concept-node-document">node document</a>.</p>
1690
+
1691
+
<p>Example: A resource being loaded with the following response header:</p>
<p>The <dfnid="link-scope-attribute">scope</dfn> attribute returns the value of this element's scope attribute.</p>
1708
+
</spec-section>
1709
+
1710
+
</spec-clause>
1711
+
1674
1712
<spec-clauseid="cache-objects">
1675
1713
<h1>Caches</h1>
1676
1714
<p>To allow authors to fully manage their content caches for offline use, the <ahref="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a> and the <ahref="https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope">WorkerGlobalScope</a> provide the asynchronous caching methods that open and manipulate <code><ahref="#cache-interface">Cache</a></code> objects. An <ahref="https://html.spec.whatwg.org/multipage/browsers.html#origin-2">origin</a> can have multiple, named <code><ahref="#cache-interface">Cache</a></code> objects, whose contents are entirely under the control of scripts. Caches are not shared across <ahref="https://html.spec.whatwg.org/multipage/browsers.html#origin-2">origins</a>, and they are completely isolated from the browser's HTTP cache.</p>
<dd><var>scriptURL</var>, a <ahref="https://url.spec.whatwg.org/#concept-url">URL</a></dd>
2741
+
<dd><var>promise</var>, a <ahref="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects">promise</a></dd>
2742
+
<dd><var>client</var>, a <ahref="#dfn-service-worker-client">service worker client</a></dd>
2743
+
</dt>
2744
+
<dt>Output</dt>
2745
+
<dd>none</dd>
2746
+
</dl>
2747
+
<ol>
2748
+
<li>If <var>client</var> is not null and <var>client</var> is not a <ahref="https://w3c.github.io/webappsec-secure-contexts/#secure-context">secure context</a>, reject <var>p</var> with a "<code><ahref="http://heycam.github.io/webidl/#securityerror">SecurityError</a></code>" exception and abort these steps.</li>
2749
+
<li>If <var>scriptURL</var> is failure, reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
2750
+
<li>If <var>scriptURL</var>'s <ahref="https://url.spec.whatwg.org/#concept-url-scheme">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
2751
+
<li>If any of the strings in <var>scriptURL</var>'s <ahref="https://url.spec.whatwg.org/#concept-url-path">path</a> contains either <ahref="https://encoding.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> "<code>%2f</code>" or <ahref="https://encoding.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> "<code>%5c</code>", reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
2752
+
<li>Let <var>scopeURL</var> be null.</li>
2753
+
<li>If <var>scopeURLString</var> is null, set <var>scopeURL</var> to the result of <ahref="https://url.spec.whatwg.org/#concept-url-parser">parsing</a> a string "<code>./</code>" with <var>scriptURL</var>.
2754
+
<pclass="note">The scope url for the registration is set to the location of the service worker script by default.</p>
2755
+
</li>
2756
+
<li>Else, set <var>scopeURL</var> to the result of <ahref="https://url.spec.whatwg.org/#concept-url-parser">parsing</a><var></var> with <ahref="https://html.spec.whatwg.org/multipage/webappapis.html#entry-settings-object">entry settings object</a>'s <ahref="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url">API base URL</a>.</li>
2757
+
<li>If <var>scopeURL</var> is failure, reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
2758
+
<li>If <var>scopeURL</var>'s <ahref="https://url.spec.whatwg.org/#concept-url-scheme">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
2759
+
<li>If any of the strings in <var>scopeURL</var>'s <ahref="https://url.spec.whatwg.org/#concept-url-path">path</a> contains either <ahref="https://encoding.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> "<code>%2f</code>" or <ahref="https://encoding.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> "<code>%5c</code>", reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
2760
+
<li>Let <var>job</var> be the result of running <ahref="#create-job-algorithm">Create Job</a> with <em>register</em>, <var>scopeURL</var>, <var>scriptURL</var>, <var>promise</var>, and <var>client</var>.</li>
2761
+
<li>Run the following substep <ahref="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>:
2762
+
<ol>
2763
+
<li>Invoke <ahref="#schedule-job-algorithm">Schedule Job</a> with <var>job</var>.</li>
0 commit comments