Skip to content

Commit ce56447

Browse files
committed
[worklets] Update global object allocation
HTML has yet again changed the fields in settings objects. Closes w3c#992 by superseding it.
1 parent b0a419f commit ce56447

File tree

2 files changed

+30
-46
lines changed

2 files changed

+30
-46
lines changed

worklets/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
SOURCEFILE=Overview.bs
88
OUTPUTFILE=Overview.html
9-
PREPROCESSOR=bikeshed.py
9+
PREPROCESSOR=bikeshed
1010
REMOTE_PREPROCESSOR_URL=https://api.csswg.org/bikeshed/
1111

1212
all: $(OUTPUTFILE)
@@ -17,4 +17,3 @@ ifneq (,$(REMOTE))
1717
else
1818
$(PREPROCESSOR) -f spec "$<" "$@"
1919
endif
20-

worklets/Overview.bs

+29-44
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,9 @@ Editor: Ian Kilpatrick, [email protected], w3cid 73001
3030
spec:fetch; type:dfn; for:/; text:fetch
3131
spec:html; type:dfn; for:/; text:browsing context
3232
spec:html; type:interface; for:/; text:Document
33-
spec:html; type:dfn; for:environment settings object;
34-
text: global object
35-
text: https state
36-
text: referrer policy
37-
spec:html; type:dfn; for:environment; text:id
3833
spec:webidl; type:dfn; for:interface; text:inherit
34+
spec:url; type:dfn; text:url; for:url
35+
spec:html; type:dfn; for:/; text:event loop
3936
</pre>
4037

4138
<pre class="anchors">
@@ -65,10 +62,6 @@ urlPrefix: http://www.ecma-international.org/ecma-262/6.0/#sec-; type: dfn;
6562
text: Invoke
6663
text: strict mode code
6764
</pre>
68-
<pre class="link-defaults">
69-
spec:url; type:dfn; text:url; for:url
70-
spec:webidl; type:dfn; for:interface; text:inherit
71-
</pre>
7265

7366
Introduction {#intro}
7467
=====================
@@ -233,14 +226,12 @@ When a user agent is to <dfn export>create a WorkletGlobalScope</dfn>, given |wo
233226
3. Let |insideSettings| be the result of <a>set up a worklet environment settings object</a>
234227
given |realmExecutionContext|, and |outsideSettings|.
235228

236-
4. Associate the |insideSettings| with |workletGlobalScope|.
237-
238-
5. Set |workletGlobalScope|'s <a>owner document</a> to |outsideSettings|'s <a>responsible
229+
4. Set |workletGlobalScope|'s <a>owner document</a> to |outsideSettings|'s <a>responsible
239230
document</a>.
240231

241-
6. Invoke the <a>initialize a global object's CSP list</a> algorithm given |workletGlobalScope|.
232+
5. Invoke the <a>initialize a global object's CSP list</a> algorithm given |workletGlobalScope|.
242233

243-
7. For each |entry| in the given |moduleResponsesMap| (in insertion order), run the following
234+
6. For each |entry| in the given |moduleResponsesMap| (in insertion order), run the following
244235
substeps:
245236

246237
1. Let |moduleURLRecord| be |entry|'s key.
@@ -264,61 +255,55 @@ When a user agent is to <dfn export>create a WorkletGlobalScope</dfn>, given |wo
264255
<div algorithm>
265256
When a user agent is to <dfn export>set up a worklet environment settings object</dfn>, given a
266257
|executionContext|, and |outsideSettings|, it must run the following steps:
267-
1. Let |inheritedResponsibleBrowsingContext| be |outsideSettings|'s <a>responsible browsing
268-
context</a>.
258+
1. Let |origin| be a unique <a>opaque origin</a>.
269259

270260
2. Let |inheritedAPIBaseURL| be |outsideSettings|'s <a>API base URL</a>.
271261

272-
3. Let |origin| be a unique <a>opaque origin</a>.
262+
3. Let |inheritedReferrerPolicy| be |outsideSettings|'s <a for="environment settings object">referrer policy</a>.
273263

274-
4. Let |inheritedHTTPSState| be |outsideSettings|'s <a>HTTPS state</a>.
264+
4. Let |inheritedEmbedderPolicy| be |outsideSettings|'s <a for="environment settings object">embedder policy</a>.
275265

276-
5. Let |inheritedReferrerPolicy| be |outsideSettings|'s <a>referrer policy</a>.
266+
5. Let |realm| be the value of |executionContext|'s Realm component.
277267

278-
6. Let |realm| be the value of |executionContext|'s Realm component.
268+
6. Let |workletGlobalScope| be |realm|'s <a for=Realm>global object</a>.
279269

280-
7. Let |workletGlobalScope| be |realm|'s <a>global object</a>.
281-
282-
8. Let |settingsObject| be a new <a>environment settings object</a> whose algorithms are defined
270+
7. Let |settingsObject| be a new <a>environment settings object</a> whose algorithms are defined
283271
as follows:
284272

285-
: The <a>realm execution context</a>
273+
: The <a for="environment settings object">realm execution context</a>
286274
:: Return |executionContext|.
287275

288-
: The <a>module map</a>.
276+
: The <a for="environment settings object">module map</a>.
289277
:: Return |workletGlobalScope|'s <a for=WorkletGlobalScope>module map</a>.
290278

291-
: The <a>responsible browsing context</a>
292-
:: Return |inheritedResponsibleBrowsingContext|.
293-
294-
: The <a>responsible document</a>
295-
:: Not applicable (the <a>responsible event loop</a> is not a <a>window event loop</a>).
279+
: The <a for="environment settings object">responsible document</a>
280+
:: Not applicable.
296281

297-
: The <a>API URL character encoding</a>
282+
: The <a for="environment settings object">API URL character encoding</a>
298283
:: Return <a>UTF-8</a>.
299284

300-
: The <a>API base URL</a>
285+
: The <a for="environment settings object">API base URL</a>
301286
:: Return |inheritedAPIBaseURL|.
302287

303288
: The <a for="environment settings object">origin</a>
304289
:: Return |origin|.
305290

306-
: The <a for="environment settings object">top-level origin</a>
307-
:: Return |outsideSettings|'s <a for="environment settings object">top-level origin</a>.
308-
309-
: The <a>HTTPS state</a>
310-
:: Return |inheritedHTTPSState|.
311-
312-
: The <a>referrer policy</a>
291+
: The <a for="environment settings object">referrer policy</a>
313292
:: Return |inheritedReferrerPolicy|.
314293

315-
9. Set |settingsObject|'s <a>id</a> to a new unique opaque string, |settingsObject|'s
316-
<a>creation URL</a> to |inheritedAPIBaseURL|, |settingsObject|'s <a>target browsing
317-
context</a> to null, and |settingsObject|'s <a>active service worker</a> to null.
294+
: The <a for="environment settings object">embedder policy</a>
295+
:: Return |inheritedEmbedderPolicy|.
296+
297+
8. Set |settingsObject|'s <a for=environment>id</a> to a new unique opaque string,
298+
<a for=environment>creation URL</a> to |inheritedAPIBaseURL|,
299+
<a for=environment>top-level creation URL</a> to null,
300+
<a for=environment>top-level origin</a> to |outsideSettings|'s <a for=environment>top-level origin</a>,
301+
<a for=environment>target browsing context</a> to null, and
302+
<a for=environment>active service worker</a> to null.
318303

319-
10. Set |realm|'s \[[HostDefined]] field to |settingsObject|.
304+
9. Set |realm|'s \[[HostDefined]] field to |settingsObject|.
320305

321-
11. Return |settingsObject|.
306+
10. Return |settingsObject|.
322307
</div>
323308

324309
Issue: Merge this with https://html.spec.whatwg.org/multipage/workers.html#set-up-a-worker-environment-settings-object

0 commit comments

Comments
 (0)