Skip to content

Commit 0a92c7f

Browse files
authored
Bikeshed improvements to *force bypass cache for import scripts flag* (#1430)
* Make the parameter |linkable|. * Add a space between "import" and "scripts".
1 parent 5059261 commit 0a92c7f

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

docs/index.bs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
935935
};
936936
</pre>
937937

938-
A {{ServiceWorkerGlobalScope}} object represents the global execution context of a [=/service worker=]. A {{ServiceWorkerGlobalScope}} object has an associated <dfn for="ServiceWorkerGlobalScope">service worker</dfn> (a [=/service worker=]). A {{ServiceWorkerGlobalScope}} object has an associated <dfn for="ServiceWorkerGlobalScope">force bypass cache for importscripts flag</dfn>. It is initially unset.
938+
A {{ServiceWorkerGlobalScope}} object represents the global execution context of a [=/service worker=]. A {{ServiceWorkerGlobalScope}} object has an associated <dfn for="ServiceWorkerGlobalScope">service worker</dfn> (a [=/service worker=]). A {{ServiceWorkerGlobalScope}} object has an associated <dfn for="ServiceWorkerGlobalScope">force bypass cache for import scripts flag</dfn>. It is initially unset.
939939

940940
Note: {{ServiceWorkerGlobalScope}} object provides generic, event-driven, time-limited script execution contexts that run at an origin. Once successfully <a>registered</a>, a [=/service worker=] is started, kept alive and killed by their relationship to events, not [=/service worker clients=]. Any type of synchronous requests must not be initiated inside of a [=/service worker=].
941941

@@ -2122,7 +2122,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
21222122
1. Set |request|'s [=service-workers mode=] to "`none`".
21232123
1. Set |request|'s [=request/cache mode=] to "`no-cache`" if any of the following are true:
21242124
* |registration|'s [=service worker registration/update via cache mode=] is "`none`".
2125-
* The [=current global object=]'s [=force bypass cache for importscripts flag=] is set.
2125+
* The [=current global object=]'s [=force bypass cache for import scripts flag=] is set.
21262126
* |registration| is [=stale=].
21272127
1. Let |response| be the result of [=fetch|fetching=] |request|.
21282128
1. If |response|’s [=response/cache state=] is not "`local`", set |registration|’s [=service worker registration/last update check time=] to the current time.
@@ -2263,7 +2263,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
22632263

22642264
A <a>job</a> has a <dfn id="dfn-job-list-of-equivalent-jobs">list of equivalent jobs</dfn> (a list of <a>jobs</a>). It is initially the empty list.
22652265

2266-
A <a>job</a> has a <dfn id="dfn-job-force-bypass-cache-flag">force bypass cache flag</dfn>. It is initially unset.
2266+
A [=job=] has a <dfn id="dfn-job-force-bypass-cache-flag">force bypass cache flag</dfn>. It is initially unset.
22672267
</div>
22682268

22692269

@@ -2585,7 +2585,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
25852585
1. Append |url| to |worker|'s [=set of used scripts=].
25862586
1. Set |worker|'s <a>script resource</a>'s <a>HTTPS state</a> to |httpsState|.
25872587
1. Set |worker|'s <a>script resource</a>'s [=script resource/referrer policy=] to |referrerPolicy|.
2588-
1. Let |runResult| be the result of running the [=Run Service Worker=] algorithm with |worker| and the *force bypass cache for importscripts flag* set if |job|'s [=job/force bypass cache flag=] is set.
2588+
1. Let |forceBypassCache| be true if |job|'s [=job/force bypass cache flag=] is set, and false otherwise.
2589+
1. Let |runResult| be the result of running the [=Run Service Worker=] algorithm with |worker| and |forceBypassCache|.
25892590
1. If |runResult| is *failure* or an [=abrupt completion=], then:
25902591
1. Invoke [=Reject Job Promise=] with |job| and `TypeError`.
25912592
1. If |newestWorker| is null, invoke [=Clear Registration=] algorithm passing |registration| as its argument.
@@ -2600,9 +2601,9 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
26002601

26012602
: Input
26022603
:: |registration|, a [=/service worker registration=]
2603-
:: *force bypass cache flag*, an optional flag unset by default
2604+
:: |forceBypassCache|, an optional boolean, false by default
26042605

2605-
Note: Implementers may use the *force bypass cache flag* to aid debugging (e.g. invocations from developer tools), and other specifications that extend service workers may also use the flag on their own needs.
2606+
Note: Implementers may use |forceBypassCache| to aid debugging (e.g. invocations from developer tools), and other specifications that extend service workers may also use the flag on their own needs.
26062607

26072608
: Output
26082609
:: None
@@ -2611,7 +2612,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
26112612
1. If |newestWorker| is null, abort these steps.
26122613
1. Let |job| be the result of running <a>Create Job</a> with *update*, |registration|'s [=service worker registration/scope url=], |newestWorker|'s [=service worker/script url=], null, and null.
26132614
1. Set |job|'s <a>worker type</a> to |newestWorker|'s [=service worker/type=].
2614-
1. Set |job|'s <a>force bypass cache flag</a> if the *force bypass cache flag* is set.
2615+
1. Set |job|'s [=force bypass cache flag=] if |forceBypassCache| is true.
26152616
1. Invoke <a>Schedule Job</a> with |job|.
26162617
</section>
26172618

@@ -2638,7 +2639,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
26382639
1. For each |registrationObject| of |registrationObjects|, [=fire an event=] on |registrationObject| named `updatefound`.
26392640
1. Let |installingWorker| be |registration|'s <a>installing worker</a>.
26402641
1. If the result of running the [=Should Skip Event=] algorithm with |installingWorker| and "install" is false, then:
2641-
1. If the result of running the [=Run Service Worker=] algorithm with |installingWorker| and the *force bypass cache for importscripts flag* set if |job|'s [=job/force bypass cache flag=] is set is *failure*, then:
2642+
1. Let |forceBypassCache| be true if |job|'s [=job/force bypass cache flag=] is set, and false otherwise.
2643+
1. If the result of running the [=Run Service Worker=] algorithm with |installingWorker| and |forceBypassCache| is *failure*, then:
26422644
1. Set |installFailed| to true.
26432645
1. Else:
26442646
1. [=Queue a task=] |task| on |installingWorker|'s [=event loop=] using the [=DOM manipulation task source=] to run the following steps:
@@ -2742,7 +2744,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
27422744

27432745
: Input
27442746
:: |serviceWorker|, a [=/service worker=]
2745-
:: *force bypass cache for importscripts flag*, an optional flag unset by default
2747+
:: |forceBypassCache|, an optional boolean, false by default
27462748
: Output
27472749
:: a [=Completion=] or *failure*
27482750

@@ -2785,7 +2787,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
27852787
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/HTTPS state=] to |serviceWorker|'s <a>script resource</a>'s <a>HTTPS state</a>.
27862788
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=] to |serviceWorker|'s <a>script resource</a>'s [=script resource/referrer policy=].
27872789
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/type=] to |serviceWorker|'s [=service worker/type=].
2788-
1. Set |workerGlobalScope|'s [=ServiceWorkerGlobalScope/force bypass cache for importscripts flag=] if the *force bypass cache for importscripts flag* is set.
2790+
1. Set |workerGlobalScope|'s [=ServiceWorkerGlobalScope/force bypass cache for import scripts flag=] if |forceBypassCache| is true.
27892791
1. Create a new {{WorkerLocation}} object and associate it with |workerGlobalScope|.
27902792
1. If |serviceWorker| is an <a>active worker</a>, and there are any <a>tasks</a> queued in |serviceWorker|'s <a>containing service worker registration</a>'s [=service worker registration/task queues=], <a lt="queue a task">queue</a> them to |serviceWorker|'s <a>event loop</a>'s [=/task queues=] in the same order using their original <a>task sources</a>.
27912793
1. Let |evaluationStatus| be the result of <a lt="run a classic script">running the classic script</a> |script| if |script| is a <a>classic script</a>, otherwise, the result of <a lt="run a module script">running the module script</a> |script| if |script| is a [=module script=].

docs/v1/index.bs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
857857
};
858858
</pre>
859859

860-
A {{ServiceWorkerGlobalScope}} object represents the global execution context of a [=/service worker=]. A {{ServiceWorkerGlobalScope}} object has an associated <dfn for="ServiceWorkerGlobalScope">service worker</dfn> (a [=/service worker=]). A {{ServiceWorkerGlobalScope}} object has an associated <dfn for="ServiceWorkerGlobalScope">force bypass cache for importscripts flag</dfn>. It is initially unset.
860+
A {{ServiceWorkerGlobalScope}} object represents the global execution context of a [=/service worker=]. A {{ServiceWorkerGlobalScope}} object has an associated <dfn for="ServiceWorkerGlobalScope">service worker</dfn> (a [=/service worker=]). A {{ServiceWorkerGlobalScope}} object has an associated <dfn for="ServiceWorkerGlobalScope">force bypass cache for import scripts flag</dfn>. It is initially unset.
861861

862862
Note: {{ServiceWorkerGlobalScope}} object provides generic, event-driven, time-limited script execution contexts that run at an origin. Once successfully <a>registered</a>, a [=/service worker=] is started, kept alive and killed by their relationship to events, not [=/service worker clients=]. Any type of synchronous requests must not be initiated inside of a [=/service worker=].
863863

@@ -2003,7 +2003,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
20032003
1. Set |request|'s [=service-workers mode=] to "`none`".
20042004
1. Set |request|'s [=request/cache mode=] to "`no-cache`" if any of the following are true:
20052005
* |registration|'s [=service worker registration/update via cache mode=] is "`none`".
2006-
* The [=current global object=]'s [=force bypass cache for importscripts flag=] is set.
2006+
* The [=current global object=]'s [=force bypass cache for import scripts flag=] is set.
20072007
* |registration| is [=stale=].
20082008
1. Let |response| be the result of [=fetch|fetching=] |request|.
20092009
1. Set |response| to |response|'s [=unsafe response=].
@@ -2143,7 +2143,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
21432143

21442144
A <a>job</a> has a <dfn id="dfn-job-list-of-equivalent-jobs">list of equivalent jobs</dfn> (a list of <a>jobs</a>). It is initially the empty list.
21452145

2146-
A <a>job</a> has a <dfn id="dfn-job-force-bypass-cache-flag">force bypass cache flag</dfn>. It is initially unset.
2146+
A [=job=] has a <dfn id="dfn-job-force-bypass-cache-flag">force bypass cache flag</dfn>. It is initially unset.
21472147
</div>
21482148

21492149

@@ -2407,7 +2407,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
24072407
1. Set |worker|'s [=script resource map=][|url|] to |response|.
24082408
1. Set |worker|'s <a>script resource</a>'s <a>HTTPS state</a> to |httpsState|.
24092409
1. Set |worker|'s <a>script resource</a>'s [=script resource/referrer policy=] to |referrerPolicy|.
2410-
1. Let |runResult| be the result of running the [=Run Service Worker=] algorithm with |worker| and the *force bypass cache for importscripts flag* set if |job|'s [=job/force bypass cache flag=] is set.
2410+
1. Let |forceBypassCache| be true if |job|'s [=job/force bypass cache flag=] is set, and false otherwise.
2411+
1. Let |runResult| be the result of running the [=Run Service Worker=] algorithm with |worker| and |forceBypassCache|.
24112412
1. If |runResult| is *failure* or an [=abrupt completion=], then:
24122413
1. Invoke [=Reject Job Promise=] with |job| and `TypeError`.
24132414
1. If |newestWorker| is null, invoke [=Clear Registration=] algorithm passing |registration| as its argument.
@@ -2422,9 +2423,9 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
24222423

24232424
: Input
24242425
:: |registration|, a [=/service worker registration=]
2425-
:: *force bypass cache flag*, an optional flag unset by default
2426+
:: |forceBypassCache|, an optional boolean, false by default
24262427

2427-
Note: Implementers may use the *force bypass cache flag* to aid debugging (e.g. invocations from developer tools), and other specifications that extend service workers may also use the flag on their own needs.
2428+
Note: Implementers may use |forceBypassCache| to aid debugging (e.g. invocations from developer tools), and other specifications that extend service workers may also use the flag on their own needs.
24282429

24292430
: Output
24302431
:: None
@@ -2433,7 +2434,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
24332434
1. If |newestWorker| is null, abort these steps.
24342435
1. Let |job| be the result of running <a>Create Job</a> with *update*, |registration|'s [=service worker registration/scope url=], |newestWorker|'s [=service worker/script url=], null, and null.
24352436
1. Set |job|'s <a>worker type</a> to |newestWorker|'s [=service worker/type=].
2436-
1. Set |job|'s <a>force bypass cache flag</a> if the *force bypass cache flag* is set.
2437+
1. Set |job|'s [=force bypass cache flag=] if |forceBypassCache| is true.
24372438
1. Invoke <a>Schedule Job</a> with |job|.
24382439
</section>
24392440

@@ -2459,7 +2460,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
24592460
1. For each |registrationObject| of |registrationObjects|, [=fire an event=] on |registrationObject| named `updatefound`.
24602461
1. Let |installingWorker| be |registration|'s <a>installing worker</a>.
24612462
1. If the result of running the [=Should Skip Event=] algorithm with |installingWorker| and "install" is false, then:
2462-
1. If the result of running the [=Run Service Worker=] algorithm with |installingWorker| and the *force bypass cache for importscripts flag* set if |job|'s [=job/force bypass cache flag=] is set is *failure*, then:
2463+
1. Let |forceBypassCache| be true if |job|'s [=job/force bypass cache flag=] is set, and false otherwise.
2464+
1. If the result of running the [=Run Service Worker=] algorithm with |installingWorker| and |forceBypassCache| is *failure*, then:
24632465
1. Set |installFailed| to true.
24642466
1. Else:
24652467
1. [=Queue a task=] |task| on |installingWorker|'s [=event loop=] using the [=DOM manipulation task source=] to run the following steps:
@@ -2559,7 +2561,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
25592561

25602562
: Input
25612563
:: |serviceWorker|, a [=/service worker=]
2562-
:: *force bypass cache for importscripts flag*, an optional flag unset by default
2564+
:: |forceBypassCache|, an optional boolean, false by default
25632565
: Output
25642566
:: a [=Completion=] or *failure*
25652567

@@ -2602,7 +2604,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
26022604
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/HTTPS state=] to |serviceWorker|'s <a>script resource</a>'s <a>HTTPS state</a>.
26032605
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=] to |serviceWorker|'s <a>script resource</a>'s [=script resource/referrer policy=].
26042606
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/type=] to |serviceWorker|'s [=service worker/type=].
2605-
1. Set |workerGlobalScope|'s [=ServiceWorkerGlobalScope/force bypass cache for importscripts flag=] if the *force bypass cache for importscripts flag* is set.
2607+
1. Set |workerGlobalScope|'s [=ServiceWorkerGlobalScope/force bypass cache for import scripts flag=] if |forceBypassCache| is true.
26062608
1. Create a new {{WorkerLocation}} object and associate it with |workerGlobalScope|.
26072609
1. If |serviceWorker| is an <a>active worker</a>, and there are any <a>tasks</a> queued in |serviceWorker|'s <a>containing service worker registration</a>'s [=service worker registration/task queues=], <a lt="queue a task">queue</a> them to |serviceWorker|'s <a>event loop</a>'s [=/task queues=] in the same order using their original <a>task sources</a>.
26082610
1. Let |evaluationStatus| be the result of <a lt="run a classic script">running the classic script</a> |script| if |script| is a <a>classic script</a>, otherwise, the result of <a lt="run a module script">running the module script</a> |script| if |script| is a [=module script=].

0 commit comments

Comments
 (0)