Skip to content

Commit ddf95c3

Browse files
committed
Fix autolinks to job's fields
1 parent 764a259 commit ddf95c3

File tree

4 files changed

+144
-136
lines changed

4 files changed

+144
-136
lines changed

docs/index.bs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,10 +2252,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
22522252

22532253
Two <a>jobs</a> are <dfn id="dfn-job-equivalent">equivalent</dfn> when their <a>job type</a> is the same and:
22542254

2255-
* For *register* and *update* <a>jobs</a>, both their [=service worker registration/scope url=] and the [=service worker/script url=] are the same.
2256-
* For *unregister* <a>jobs</a>, their [=service worker registration/scope url=] is the same.
2255+
* For *register* and *update* <a>jobs</a>, both their [=job/scope url=] and the [=job/script url=] are the same.
2256+
* For *unregister* <a>jobs</a>, their [=job/scope url=] is the same.
22572257

2258-
A <dfn id="dfn-job-queue">job queue</dfn> is a thread safe queue used to synchronize the set of concurrent <a>jobs</a>. The <a>job queue</a> contains <a>jobs</a> as its elements. The <a>job queue</a> *should* satisfy the general properties of FIFO queue. A user agent *must* maintain a separate <a>job queue</a> for each [=/service worker registration=] keyed by its [=service worker registration/scope url=]. A <a>job queue</a> is initially empty. Unless stated otherwise, the <a>job queue</a> referenced from the algorithm steps is a <a>job queue</a> for the <a>job</a>'s [=service worker registration/scope url=].
2258+
A <dfn id="dfn-job-queue">job queue</dfn> is a thread safe queue used to synchronize the set of concurrent <a>jobs</a>. The <a>job queue</a> contains <a>jobs</a> as its elements. The <a>job queue</a> *should* satisfy the general properties of FIFO queue. A user agent *must* maintain a separate <a>job queue</a> for each [=/service worker registration=] keyed by its [=service worker registration/scope url=]. A <a>job queue</a> is initially empty. Unless stated otherwise, the <a>job queue</a> referenced from the algorithm steps is a <a>job queue</a> for the <a>job</a>'s [=job/scope url=].
22592259

22602260
<section algorithm>
22612261
<h3 id="create-job-algorithm"><dfn>Create Job</dfn></h3>
@@ -2392,24 +2392,24 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
23922392
: Output
23932393
:: none
23942394

2395-
1. If the result of running <a>potentially trustworthy origin</a> with the [=environment settings object/origin=] of |job|'s [=service worker/script url=] as the argument is <code>Not Trusted</code>, then:
2395+
1. If the result of running <a>potentially trustworthy origin</a> with the [=environment settings object/origin=] of |job|'s [=job/script url=] as the argument is <code>Not Trusted</code>, then:
23962396
1. Invoke <a>Reject Job Promise</a> with |job| and a "{{SecurityError}}" exception.
23972397
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
2398-
1. If the [=environment settings object/origin=] of |job|'s [=service worker/script url=] is not |job|'s [=job/referrer=]'s [=environment settings object/origin=], then:
2398+
1. If the [=environment settings object/origin=] of |job|'s [=job/script url=] is not |job|'s [=job/referrer=]'s [=environment settings object/origin=], then:
23992399
1. Invoke <a>Reject Job Promise</a> with |job| and a "{{SecurityError}}" exception.
24002400
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
2401-
1. If the [=environment settings object/origin=] of |job|'s [=service worker registration/scope url=] is not |job|'s [=job/referrer=]'s [=environment settings object/origin=], then:
2401+
1. If the [=environment settings object/origin=] of |job|'s [=job/scope url=] is not |job|'s [=job/referrer=]'s [=environment settings object/origin=], then:
24022402
1. Invoke <a>Reject Job Promise</a> with |job| and a "{{SecurityError}}" exception.
24032403
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
2404-
1. Let |registration| be the result of running the <a>Get Registration</a> algorithm passing |job|'s [=service worker registration/scope url=] as the argument.
2404+
1. Let |registration| be the result of running the <a>Get Registration</a> algorithm passing |job|'s [=job/scope url=] as the argument.
24052405
1. If |registration| is not null, then:
24062406
1. If |registration|'s <a>uninstalling flag</a> is set, unset it.
24072407
1. Let |newestWorker| be the result of running the <a>Get Newest Worker</a> algorithm passing |registration| as the argument.
2408-
1. If |newestWorker| is not null and |job|'s [=service worker/script url=] [=url/equals=] |newestWorker|'s [=service worker/script url=] with the *exclude fragments flag* set, then:
2409-
1. Invoke <a>Resolve Job Promise</a> with |job| and the {{ServiceWorkerRegistration}} object which represents |registration|.
2410-
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
2408+
1. If |newestWorker| is not null and |job|'s [=job/script url=] [=url/equals=] |newestWorker|'s [=service worker/script url=] with the *exclude fragments flag* set, then:
2409+
1. Invoke <a>Resolve Job Promise</a> with |job| and the {{ServiceWorkerRegistration}} object which represents |registration|.
2410+
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
24112411
1. Else:
2412-
1. Invoke <a>Set Registration</a> algorithm passing |job|'s [=service worker registration/scope url=] as its argument.
2412+
1. Invoke <a>Set Registration</a> algorithm passing |job|'s [=job/scope url=] as its argument.
24132413
1. Invoke <a>Update</a> algorithm passing |job| as the argument.
24142414
</section>
24152415

@@ -2421,22 +2421,22 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
24212421
: Output
24222422
:: none
24232423

2424-
1. Let |registration| be the result of running the <a>Get Registration</a> algorithm passing |job|'s [=service worker registration/scope url=] as the argument.
2424+
1. Let |registration| be the result of running the <a>Get Registration</a> algorithm passing |job|'s [=job/scope url=] as the argument.
24252425
1. If |registration| is null or |registration|'s <a>uninstalling flag</a> is set, then:
24262426
1. Invoke <a>Reject Job Promise</a> with |job| and a <code>TypeError</code>.
24272427
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
24282428
1. Let |newestWorker| be the result of running <a>Get Newest Worker</a> algorithm passing |registration| as the argument.
2429-
1. If |job|'s <a>job type</a> is *update*, and |newestWorker|'s [=service worker/script url=] does not [=url/equal=] |job|'s [=service worker/script url=] with the *exclude fragments flag* set, then:
2429+
1. If |job|'s <a>job type</a> is *update*, and |newestWorker|'s [=service worker/script url=] does not [=url/equal=] |job|'s [=job/script url=] with the *exclude fragments flag* set, then:
24302430
1. Invoke <a>Reject Job Promise</a> with |job| and a <code>TypeError</code>.
24312431
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
24322432
1. Let |httpsState| be "<code>none</code>".
24332433
1. Let |referrerPolicy| be the empty string.
24342434
1. Switching on |job|'s <a>worker type</a>, run these substeps with the following options:
24352435
<!-- TODO: reorganize algorithm so that the worker environment is created before fetching happens -->
24362436
: "<code>classic</code>"
2437-
:: <a>Fetch a classic worker script</a> given |job|’s <a lt="URL serializer">serialized</a> [=service worker/script url=], |job|’s [=job/client=], "<code>serviceworker</code>", and the to-be-created <a>environment settings object</a> for this service worker.
2437+
:: <a>Fetch a classic worker script</a> given |job|’s <a lt="URL serializer">serialized</a> [=job/script url=], |job|’s [=job/client=], "<code>serviceworker</code>", and the to-be-created <a>environment settings object</a> for this service worker.
24382438
: "<code>module</code>"
2439-
:: <a>Fetch a module worker script graph</a> given |job|’s <a lt="URL serializer">serialized</a> [=service worker/script url=], |job|’s [=job/client=], "<code>serviceworker</code>", "<code>omit</code>", and the to-be-created <a>environment settings object</a> for this service worker.
2439+
:: <a>Fetch a module worker script graph</a> given |job|’s <a lt="URL serializer">serialized</a> [=job/script url=], |job|’s [=job/client=], "<code>serviceworker</code>", "<code>omit</code>", and the to-be-created <a>environment settings object</a> for this service worker.
24402440

24412441
To [=fetching scripts/perform the fetch=] given |request|, run the following steps if the [=fetching scripts/is top-level=] flag is set:
24422442

@@ -2465,9 +2465,9 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
24652465
1. Let |scopeURL| be |registration|'s [=service worker registration/scope url=].
24662466
1. Let |maxScopeString| be null.
24672467
1. If |serviceWorkerAllowed| is null, then:
2468-
1. Set |maxScopeString| to "<code>/</code>" concatenated with the strings, except the last string that denotes the script's file name, in |job|'s [=service worker/script url=]'s [=url/path=] (including empty strings), separated from each other by "<code>/</code>".
2468+
1. Set |maxScopeString| to "<code>/</code>" concatenated with the strings, except the last string that denotes the script's file name, in |job|'s [=job/script url=]'s [=url/path=] (including empty strings), separated from each other by "<code>/</code>".
24692469
1. Else:
2470-
1. Let |maxScope| be the result of <a lt="URL parser">parsing</a> |serviceWorkerAllowed| with |job|'s [=service worker/script url=].
2470+
1. Let |maxScope| be the result of <a lt="URL parser">parsing</a> |serviceWorkerAllowed| with |job|'s [=job/script url=].
24712471
1. Set |maxScopeString| to "<code>/</code>" concatenated with the strings in |maxScope|'s [=url/path=] (including empty strings), separated from each other by "<code>/</code>".
24722472
1. Let |scopeString| be "<code>/</code>" concatenated with the strings in |scopeURL|'s [=url/path=] (including empty strings), separated from each other by "<code>/</code>".
24732473
1. If |scopeString| starts with |maxScopeString|, do nothing.
@@ -2491,13 +2491,13 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
24912491

24922492
Else, continue the rest of these steps after the algorithm's asynchronous completion, with |script| being the asynchronous completion value.
24932493

2494-
1. If |newestWorker| is not null, |newestWorker|'s [=service worker/script url=] [=url/equals=] |job|'s [=service worker/script url=] with the *exclude fragments flag* set, and |script| is a byte-for-byte match with |newestWorker|'s <a>script resource</a>, then:
2494+
1. If |newestWorker| is not null, |newestWorker|'s [=service worker/script url=] [=url/equals=] |job|'s [=job/script url=] with the *exclude fragments flag* set, and |script| is a byte-for-byte match with |newestWorker|'s <a>script resource</a>, then:
24952495
1. Invoke <a>Resolve Job Promise</a> with |job| and the {{ServiceWorkerRegistration}} object which represents |registration|.
24962496
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
24972497
1. Else:
24982498
1. Let |worker| be a new [=/service worker=].
24992499
1. Generate a unique opaque string and set |worker|'s <a>id</a> to the value.
2500-
1. Set |worker|'s [=service worker/script url=] to |job|'s [=service worker/script url=], |worker|'s <a>script resource</a> to |script|, and |worker|'s <a>type</a> to |job|'s <a>worker type</a>.
2500+
1. Set |worker|'s [=service worker/script url=] to |job|'s [=job/script url=], |worker|'s <a>script resource</a> to |script|, and |worker|'s <a>type</a> to |job|'s <a>worker type</a>.
25012501
1. Set |worker|'s <a>script resource</a>'s <a>HTTPS state</a> to |httpsState|.
25022502
1. Set |worker|'s <a>script resource</a>'s [=script resource/referrer policy=] to |referrerPolicy|.
25032503
1. Invoke <a>Run Service Worker</a> algorithm with |worker| as the argument.
@@ -2962,10 +2962,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
29622962
: Output
29632963
:: none
29642964

2965-
1. If the [=environment settings object/origin=] of |job|'s [=service worker registration/scope url=] is not |job|'s [=job/client=]'s [=environment settings object/origin=], then:
2965+
1. If the [=environment settings object/origin=] of |job|'s [=job/scope url=] is not |job|'s [=job/client=]'s [=environment settings object/origin=], then:
29662966
1. Invoke <a>Reject Job Promise</a> with |job| and a "{{SecurityError}}" exception.
29672967
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
2968-
1. Let |registration| be the result of running <a>Get Registration</a> algorithm passing |job|'s [=service worker registration/scope url=] as the argument.
2968+
1. Let |registration| be the result of running <a>Get Registration</a> algorithm passing |job|'s [=job/scope url=] as the argument.
29692969
1. If |registration| is null, then:
29702970
1. Invoke <a>Resolve Job Promise</a> with |job| and false.
29712971
1. Invoke <a>Finish Job</a> with |job| and abort these steps.

0 commit comments

Comments
 (0)