@@ -349,6 +349,9 @@ Note: As an example the <a>worklet global scope type</a> might be a {{PaintWorkl
349
349
A {{Worklet}} has a list of the <dfn export>worklet's WorkletGlobalScopes</dfn> . Initially this list
350
350
is empty; it is populated when the user agent chooses to create its {{WorkletGlobalScope}} .
351
351
352
+ A {{Worklet}} has a <dfn export>worklet destination type</dfn> . This is used for setting the <a
353
+ for=request> destination</a> requests from <a>fetch a module worker script graph</a> .
354
+
352
355
A {{Worklet}} has a <dfn>module responses map</dfn> . This is a ordered map of module URLs to values
353
356
that are a <a>fetch</a> responses. The map's entries are ordered based on their insertion order.
354
357
Access to this map should be thread-safe.
@@ -394,7 +397,9 @@ When the <dfn method for=Worklet>addModule(|moduleURL|, |options|)</dfn> method
394
397
395
398
9. Let |workletGlobalScopeType| be |worklet|'s <a>worklet global scope type</a> .
396
399
397
- 10. If the <a>worklet's WorkletGlobalScopes</a> is empty, run the following steps:
400
+ 10. Let |destination| be |worklet|'s <a>worklet destination type</a> .
401
+
402
+ 11. If the <a>worklet's WorkletGlobalScopes</a> is empty, run the following steps:
398
403
399
404
1. <a>Create a WorkletGlobalScope</a> given |workletGlobalScopeType|, |moduleResponsesMap|,
400
405
and |outsideSettings|.
@@ -409,22 +414,22 @@ When the <dfn method for=Worklet>addModule(|moduleURL|, |options|)</dfn> method
409
414
410
415
Wait for this step to complete before continuing.
411
416
412
- 11 . Let |pendingTaskStruct| be a new <a>pending tasks struct</a> with <a
417
+ 12 . Let |pendingTaskStruct| be a new <a>pending tasks struct</a> with <a
413
418
for="pending tasks struct"> counter</a> initialized to the length of <a>worklet's
414
419
WorkletGlobalScopes</a> .
415
420
416
- 12 . For each |workletGlobalScope| in the <a>worklet's WorkletGlobalScopes</a> , <a>queue a
421
+ 13 . For each |workletGlobalScope| in the <a>worklet's WorkletGlobalScopes</a> , <a>queue a
417
422
task</a> on the |workletGlobalScope| to <a>fetch and invoke a worklet script</a> given
418
- |workletGlobalScope|, |moduleURLRecord|, |moduleResponsesMap |, |credentialOptions |,
419
- |outsideSettings|, |pendingTaskStruct|, and |promise|.
423
+ |workletGlobalScope|, |moduleURLRecord|, |destination |, |moduleResponsesMap |,
424
+ |credentialOptions|, | outsideSettings|, |pendingTaskStruct|, and |promise|.
420
425
421
426
Note: The rejecting and resolving of the |promise| occurs within the <a>fetch and invoke a
422
427
worklet script</a> algorithm.
423
428
</div>
424
429
425
430
<div algorithm>
426
431
When the user agent is to <dfn>fetch and invoke a worklet script</dfn> given |workletGlobalScope|,
427
- |moduleURLRecord|, |moduleResponsesMap|, |credentialOptions|, |outsideSettings|,
432
+ |moduleURLRecord|, |destination|, | moduleResponsesMap|, |credentialOptions|, |outsideSettings|,
428
433
|pendingTaskStruct|, and |promise|, the user agent <em> must</em> run the following steps:
429
434
430
435
Note: This algorithm is to be run within the <a>worklet global scope execution environment</a> .
@@ -433,8 +438,8 @@ When the user agent is to <dfn>fetch and invoke a worklet script</dfn> given |wo
433
438
object</a> .
434
439
435
440
2. Let |script| by the result of <a>fetch a worklet script</a> given |moduleURLRecord|,
436
- |moduleResponsesMap|, |credentialOptions|, |outsideSettings|, and |insideSettings| when it
437
- asynchronously completes.
441
+ |destination|, | moduleResponsesMap|, |credentialOptions|, |outsideSettings|, and
442
+ |insideSettings| when it asynchronously completes.
438
443
439
444
3. If |script| is null, then <a>queue a task</a> on |outsideSettings|'s <a>responsible event
440
445
loop</a> to run these steps:
@@ -472,14 +477,14 @@ When the user agent is to <dfn>fetch and invoke a worklet script</dfn> given |wo
472
477
</div>
473
478
474
479
<div algorithm>
475
- When the user agent is to <dfn>fetch a worklet script</dfn> given |moduleURLRecord|,
480
+ When the user agent is to <dfn>fetch a worklet script</dfn> given |moduleURLRecord|, |destination|,
476
481
|moduleResponsesMap|, |credentialOptions|, |outsideSettings|, and |insideSettings|, the user agent
477
482
<em> must</em> run the following steps:
478
483
479
484
Note: This algorithm is to be run within the <a>worklet global scope execution environment</a> .
480
485
481
- 1. <a>Fetch a module worker script graph</a> given |moduleURLRecord|, |outsideSettings|, "script",
482
- |credentialOptions|, and |insideSettings|.
486
+ 1. <a>Fetch a module worker script graph</a> given |moduleURLRecord|, |outsideSettings|,
487
+ |destination|, | credentialOptions|, and |insideSettings|.
483
488
484
489
To <a>perform the fetch</a> given |request|, perform the following steps:
485
490
0 commit comments