Skip to content

Commit ddad77d

Browse files
committed
Backport c5fae3b to V1
1 parent ef69382 commit ddad77d

File tree

2 files changed

+30
-100
lines changed

2 files changed

+30
-100
lines changed

docs/v1/index.bs

Lines changed: 11 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ Markup Shorthands: css no
2222

2323
<pre class=biblio>
2424
{
25-
"promises-guide": {
26-
"href": "https://www.w3.org/2001/tag/doc/promises-guide",
27-
"title": "Writing Promise-Using Specifications",
28-
"date": "24 July 2015",
29-
"status": "Finding of the W3C TAG",
30-
"publisher": "W3C TAG"
31-
},
3225
"unsanctioned-tracking": {
3326
"href": "https://www.w3.org/2001/tag/doc/unsanctioned-tracking/",
3427
"title": "Unsanctioned Web Tracking",
@@ -40,13 +33,15 @@ Markup Shorthands: css no
4033
</pre>
4134

4235
<pre class=link-defaults>
43-
spec: dom; type: interface; text: Document
44-
spec: html; type: element; text: link
45-
spec: url; type: dfn; text: is local
36+
spec: dom;
37+
type: interface; text: Document
38+
spec: html;
39+
type: element; text: link
40+
type: dfn; text: task queues; for: /
4641
</pre>
4742

4843
<pre class=anchors>
49-
spec: dom-ls; urlPrefix: https://dom.spec.whatwg.org/
44+
spec: DOM; urlPrefix: https://dom.spec.whatwg.org/
5045
type: dfn; text: ASCII case-insensitive; url: ascii-case-insensitive
5146

5247
spec: ecma-262; urlPrefix: http://tc39.github.io/ecma262/
@@ -66,29 +61,20 @@ spec: csp2; urlPrefix: https://w3c.github.io/webappsec-csp/2/
6661

6762
spec: fetch; urlPrefix: https://fetch.spec.whatwg.org/
6863
type: dfn
69-
text: basic filtered response; url: concept-filtered-response-basic
7064
text: cancel a ReadableStream; url: concept-cancel-readablestream
7165
text: close ReadableStream; url: concept-close-readablestream
7266
text: construct a ReadableStream; url: concept-construct-readablestream
73-
text: CORS filtered response; url: concept-filtered-response-cors
7467
text: disturbed; url: concept-body-disturbed
7568
text: empty; url: concept-empty-readablestream
7669
text: enqueue a chunk to ReadableStream; url: concept-enqueue-readablestream
7770
text: error ReadableStream; url: concept-error-readablestream
7871
text: errored; url: concept-readablestream-errored
79-
text: extract a mime type; url: concept-header-extract-mime-type
8072
text: fetch; url: concept-fetch
81-
text: filtered response; url: concept-filtered-response
8273
text: get a reader; url: concept-get-reader
83-
text: header; url: concept-header
8474
text: http fetch; url: concept-http-fetch
8575
text: HTTPS state value; url: concept-https-state-value
8676
text: internal response; url: concept-internal-response
8777
text: locked; url: concept-body-locked
88-
text: navigation request
89-
text: network error; url: concept-network-error
90-
text: non-subresource request
91-
text: ok status; url: ok-status
9278
text: opaque filtered response; url: concept-filtered-response-opaque
9379
text: potential-navigation-or-subresource request
9480
text: process response
@@ -100,8 +86,6 @@ spec: fetch; urlPrefix: https://fetch.spec.whatwg.org/
10086
text: response; for: fetch; url: concept-response
10187
text: skip service worker flag
10288
text: stream; url: concept-body-stream
103-
text: subresource request
104-
text: synchronous flag
10589
text: terminate; url: concept-fetch-terminate
10690
text: guard; for: headers; url: concept-headers-guard
10791
for: Body; urlPrefix: #concept-body-
@@ -110,61 +94,16 @@ spec: fetch; urlPrefix: https://fetch.spec.whatwg.org/
11094
text: name
11195
text: parsing; url: parse
11296
for: request; urlPrefix: #concept-request-
113-
text: cache mode
114-
text: client
115-
text: destination
116-
text: header list
117-
text: initiator
118-
text: method
119-
text: redirect mode
12097
text: request
121-
text: reserved client
122-
text: target client id
123-
text: url
98+
text: origin
12499
for: response; urlPrefix: #concept-response-
125-
text: body
126-
text: cache state
127-
text: header list
128-
text: https state
129100
text: response
130-
text: status
131-
text: termination reason
132-
text: type
133-
type: interface
134-
text: Headers
135-
text: Request
136-
text: RequestInfo
137-
text: Response
138-
type: attribute; for: Request
139-
text: headers; url: dom-request-headers
140-
type: method
141-
text: get(name); for: Headers; url: dom-headers-get
142-
text: fetch(input, init); for: GlobalFetch; url: dom-global-fetch
143101

144102
spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/
145103
type: dfn
146104
urlPrefix: browsers.html
147105
text: ancestor origins array; for: Location; url: concept-location-ancestor-origins-array
148106
text: origin; for: resource; url: origin-2
149-
urlPrefix: interaction.html
150-
text: has focus steps
151-
urlPrefix: webappapis.html
152-
text: dom manipulation task source
153-
text: environment
154-
text: run a classic script
155-
text: run a module script
156-
text: task queue; for: event loop
157-
for: environment; urlPrefix: #concept-environment-
158-
text: active service worker
159-
text: creation URL
160-
text: id
161-
urlPrefix: workers.html
162-
text: shared workers
163-
text: web worker; url: workers
164-
type: event
165-
urlPrefix: indices.html
166-
text: DOMContentLoaded; for: Document; url: event-domcontentloaded
167-
text: message; for: Window; url: event-message
168107

169108
spec: page-visibility; urlPrefix: https://www.w3.org/TR/page-visibility/
170109
type: enum; text: VisibilityState; url: VisibilityState
@@ -177,11 +116,6 @@ spec: secure-contexts; urlPrefix: https://w3c.github.io/webappsec-secure-context
177116
text: risks associated with insecure contexts; url: threat-risks
178117
text: secure context
179118

180-
spec: promises-guide; urlPrefix: https://www.w3.org/2001/tag/doc/promises-guide#
181-
type: dfn
182-
text: waiting for all
183-
text: transforming; url: transforming-by
184-
185119
spec: quota-api; urlPrefix: http://www.w3.org/TR/quota-api/
186120
type: attribute; for: ServiceWorkerGlobalScope
187121
text: onbeforeevicted; url: widl-ServiceWorkerGlobalScope-onbeforeevicted
@@ -256,7 +190,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
256190
<p>A <a href="#dfn-service-worker-registration">service worker registration</a> has an associated <dfn export id="dfn-active-worker">active worker</dfn> (a <a href="#dfn-service-worker">service worker</a> or null) whose <a href="#dfn-state">state</a> is either <em>activating</em> or <em>activated</em>. It is initially set to null.</p>
257191
<p>A <a href="#dfn-service-worker-registration">service worker registration</a> has an associated <dfn id="dfn-last-update-check-time">last update check time</dfn>. It is initially set to null.</p>
258192
<p>A <a href="#dfn-service-worker-registration">service worker registration</a> has an associated <dfn id="dfn-uninstalling-flag">uninstalling flag</dfn>. It is initially unset.</p>
259-
<p>A <a href="#dfn-service-worker-registration">service worker registration</a> has one or more <dfn id="dfn-service-worker-registration-task-queue" for="service worker registration">task queues</dfn> that back up the <a>tasks</a> from its <a href="#dfn-active-worker">active worker</a>'s <a>event loop</a>'s corresponding <a for="event loop">task queues</a>. (The target task sources for this back up operation are the <a href="#dfn-handle-fetch-task-source">handle fetch task source</a> and the <a href="#dfn-handle-functional-event-task-source">handle functional event task source</a>.) The user agent dumps the <a href="#dfn-active-worker">active worker</a>'s <a>tasks</a> to the <a href="#dfn-service-worker-registration">service worker registration</a>'s <a for="service worker registration">task queues</a> when the <a href="#dfn-active-worker">active worker</a> is <a href="#terminate-service-worker-algorithm">terminated</a> and <a lt="queue a task">re-queues those tasks</a> to the <a href="#dfn-active-worker">active worker</a>'s <a>event loop</a>'s corresponding <a for="event loop">task queues</a> when the <a href="#dfn-active-worker">active worker</a> spins off. Unlike the <a for="event loop">task queues</a> owned by <a>event loops</a>, the <a href="#dfn-service-worker-registration">service worker registration</a>'s <a for="service worker registration">task queues</a> are not processed by any <a>event loops</a> in and of itself.</p>
193+
<p>A <a href="#dfn-service-worker-registration">service worker registration</a> has one or more <dfn id="dfn-service-worker-registration-task-queue" for="service worker registration">task queues</dfn> that back up the <a>tasks</a> from its <a href="#dfn-active-worker">active worker</a>'s <a>event loop</a>'s corresponding <a for="/">task queues</a>. (The target task sources for this back up operation are the <a href="#dfn-handle-fetch-task-source">handle fetch task source</a> and the <a href="#dfn-handle-functional-event-task-source">handle functional event task source</a>.) The user agent dumps the <a href="#dfn-active-worker">active worker</a>'s <a>tasks</a> to the <a href="#dfn-service-worker-registration">service worker registration</a>'s <a for="service worker registration">task queues</a> when the <a href="#dfn-active-worker">active worker</a> is <a href="#terminate-service-worker-algorithm">terminated</a> and <a lt="queue a task">re-queues those tasks</a> to the <a href="#dfn-active-worker">active worker</a>'s <a>event loop</a>'s corresponding <a for="/">task queues</a> when the <a href="#dfn-active-worker">active worker</a> spins off. Unlike the <a for="/">task queues</a> owned by <a>event loops</a>, the <a href="#dfn-service-worker-registration">service worker registration</a>'s <a for="service worker registration">task queues</a> are not processed by any <a>event loops</a> in and of itself.</p>
260194

261195
<section>
262196
<h4 id="service-worker-registration-lifetime">Lifetime</h4>
@@ -1781,7 +1715,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
17811715
<tr>
17821716
<td><dfn event id="service-worker-global-scope-fetch-event"><code>fetch</code></dfn></td>
17831717
<td>{{FetchEvent}}</td>
1784-
<td>[<a href="#dfn-functional-events">Functional event</a>] The <a>http fetch</a> invokes <a href="#on-fetch-request-algorithm">Handle Fetch</a> with <var>request</var>. As a result of performing <a href="#on-fetch-request-algorithm">Handle Fetch</a>, the <a href="#dfn-service-worker-global-scope-service-worker">service worker</a> returns a <a for="fetch">response</a> to the <a>http fetch</a>. The <a for="fetch">response</a>, represented by a {{Response}} object, can be retrieved from a {{Cache}} object or directly from network using {{GlobalFetch/fetch(input, init)|self.fetch(input, init)}} method. (A custom {{Response}} object can be another option.)</td>
1718+
<td>[<a href="#dfn-functional-events">Functional event</a>] The <a>http fetch</a> invokes <a href="#on-fetch-request-algorithm">Handle Fetch</a> with <var>request</var>. As a result of performing <a href="#on-fetch-request-algorithm">Handle Fetch</a>, the <a href="#dfn-service-worker-global-scope-service-worker">service worker</a> returns a <a for="fetch">response</a> to the <a>http fetch</a>. The <a for="fetch">response</a>, represented by a {{Response}} object, can be retrieved from a {{Cache}} object or directly from network using {{WindowOrWorkerGlobalScope/fetch(input, init)|self.fetch(input, init)}} method. (A custom {{Response}} object can be another option.)</td>
17851719
</tr>
17861720
<tr>
17871721
<td><dfn event id="service-worker-global-scope-message-event"><code>message</code></dfn></td>
@@ -3115,7 +3049,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
31153049
<li>Set <var>workerGlobalScope</var>'s <a for="WorkerGlobalScope">referrer policy</a> to <var>serviceWorker</var>'s <a>script resource</a>'s <a href="#dfn-referrer-policy">referrer policy</a>.</li>
31163050
<li>Set <var>workerGlobalScope</var>'s <a for="WorkerGlobalScope">type</a> to <var>serviceWorker</var>'s <a href="#dfn-type">type</a>.</li>
31173051
<li>Create a new {{WorkerLocation}} object and associate it with <var>workerGlobalScope</var>.</li>
3118-
<li>If <var>serviceWorker</var> is an <a href="#dfn-active-worker">active worker</a>, and there are any <a>tasks</a> queued in <var>serviceWorker</var>'s <a href="#dfn-containing-service-worker-registration">containing service worker registration</a>'s <a for="service worker registration">task queues</a>, <a lt="queue a task">queue</a> them to <var>serviceWorker</var>'s <a>event loop</a>'s <a for="event loop">task queues</a> in the same order using their original <a>task sources</a>.</li>
3052+
<li>If <var>serviceWorker</var> is an <a href="#dfn-active-worker">active worker</a>, and there are any <a>tasks</a> queued in <var>serviceWorker</var>'s <a href="#dfn-containing-service-worker-registration">containing service worker registration</a>'s <a for="service worker registration">task queues</a>, <a lt="queue a task">queue</a> them to <var>serviceWorker</var>'s <a>event loop</a>'s <a for="/">task queues</a> in the same order using their original <a>task sources</a>.</li>
31193053
<li>If <var>script</var> is a <a>classic script</a>, then <a lt="run a classic script">run the classic script</a> <var>script</var>. Otherwise, it is a <a>module script</a>; <a lt="run a module script">run the module script</a> <var>script</var>.
31203054
<p class="note">In addition to the usual possibilities of returning a value or failing due to an exception, this could be prematurely aborted by the <a>kill a worker</a> or <a>terminate a worker</a> algorithms.</p>
31213055
</li>
@@ -3145,7 +3079,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
31453079
<li>If <var>serviceWorker</var> is not running, abort these steps.</li>
31463080
<li>Let <var>serviceWorkerGlobalScope</var> be <var>serviceWorker</var>'s <a>environment settings object</a>'s <a for="environment settings object">global object</a>.</li>
31473081
<li>Set <var>serviceWorkerGlobalScope</var>'s closing flag to true.</li>
3148-
<li>If there are any <a>tasks</a>, whose <a>task source</a> is either the <a href="#dfn-handle-fetch-task-source">handle fetch task source</a> or the <a href="#dfn-handle-functional-event-task-source">handle functional event task source</a>, queued in <var>serviceWorkerGlobalScope</var>'s <a>event loop</a>'s <a for="event loop">task queues</a>, <a lt="queue a task">queue</a> them to <var>serviceWorker</var>'s <a href="#dfn-containing-service-worker-registration">containing service worker registration</a>'s corresponding <a for="service worker registration">task queues</a> in the same order using their original <a>task sources</a>, and discard all the <a>tasks</a> (including <a>tasks</a> whose <a>task source</a> is neither the <a href="#dfn-handle-fetch-task-source">handle fetch task source</a> nor the <a href="#dfn-handle-functional-event-task-source">handle functional event task source</a>) from <var>serviceWorkerGlobalScope</var>'s <a>event loop</a>'s <a for="event loop">task queues</a> without processing them.
3082+
<li>If there are any <a>tasks</a>, whose <a>task source</a> is either the <a href="#dfn-handle-fetch-task-source">handle fetch task source</a> or the <a href="#dfn-handle-functional-event-task-source">handle functional event task source</a>, queued in <var>serviceWorkerGlobalScope</var>'s <a>event loop</a>'s <a for="/">task queues</a>, <a lt="queue a task">queue</a> them to <var>serviceWorker</var>'s <a href="#dfn-containing-service-worker-registration">containing service worker registration</a>'s corresponding <a for="service worker registration">task queues</a> in the same order using their original <a>task sources</a>, and discard all the <a>tasks</a> (including <a>tasks</a> whose <a>task source</a> is neither the <a href="#dfn-handle-fetch-task-source">handle fetch task source</a> nor the <a href="#dfn-handle-functional-event-task-source">handle functional event task source</a>) from <var>serviceWorkerGlobalScope</var>'s <a>event loop</a>'s <a for="/">task queues</a> without processing them.
31493083
<p class="note">This effectively means that the fetch events and the other functional events such as push events are backed up by the registration's task queues while the other tasks including message events are discarded.</p>
31503084
</li>
31513085
<li>Abort the script currently running in <var>serviceWorker</var>.</li>

0 commit comments

Comments
 (0)