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
Copy file name to clipboardExpand all lines: spec/service_worker/index.html
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1676,15 +1676,23 @@ <h1>Processing</h1>
1676
1676
</ol>
1677
1677
</spec-algorithm>
1678
1678
1679
-
<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>
1679
+
<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 <ahref="https://www.w3.org/TR/html5/infrastructure.html#in-a-document">inserted into a document</a>, a <ahref="#dfn-serviceworker-link">serviceworker link</a> is created on a <ahref="https://html.spec.whatwg.org/multipage/semantics.html#the-link-element">link</a> element that is already <ahref="https://html.spec.whatwg.org/multipage/infrastructure.html#in-a-document">in a Document</a>, or the <ahref="https://html.spec.whatwg.org/multipage/semantics.html#attr-link-href">href</a> or <ahref="#link-scope-attribute">scope</a> attributes of the <ahref="https://html.spec.whatwg.org/multipage/semantics.html#the-link-element">link</a> element of a <ahref="#dfn-serviceworker-link">serviceworker link</a> is changed, the user agent <emclass="rfc2119" title="SHOULD">should</em> run these steps or their <ahref="#dfn-processing-equivalence">equivalent</a>:</p>
1680
1680
1681
1681
<spec-algorithm>
1682
1682
<ol>
1683
1683
<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>
1684
1684
<li>Let <var>client</var> be the document's <ahref="#dfn-service-worker-container-interface-client">service worker client</a>.</li>
1685
1685
<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>
1686
1686
<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>
1687
-
<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>, <var>client</var>, and <var>client</var>'s <ahref="https://html.spec.whatwg.org/multipage/browsers.html#origin-2">origin</a>.</li>
1687
+
<li>Let <var>promise</var> be a new <ahref="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects">promise</a>.</li>
1688
+
<li>Invoke <ahref="#start-register-algorithm">Start Register</a> with <var>scopeURL</var>, <var>scriptURL</var>, <var>promise</var>, <var>client</var>, and <var>client</var>'s <ahref="https://html.spec.whatwg.org/multipage/browsers.html#origin-2">origin</a>.</li>
1689
+
<li>Run the following substeps <ahref="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a>:
1690
+
<ol>
1691
+
<li>Wait until <var>promise</var> settles.</li>
1692
+
<li>If <var>promise</var> rejected, <ahref="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">queue a task</a> to <ahref="https://html.spec.whatwg.org/#fire-a-simple-event">fire a simple event</a> named <code>error</code> at the <ahref="https://html.spec.whatwg.org/multipage/semantics.html#the-link-element">link</a> element.</li>
1693
+
<li>If <var>promise</var> resolved, <ahref="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">queue a task</a> to <ahref="https://html.spec.whatwg.org/#fire-a-simple-event">fire a simple event</a> named <code>load</code> at the <ahref="https://html.spec.whatwg.org/multipage/semantics.html#the-link-element">link</a> element.</li>
0 commit comments