From 33123c443039caad2db7ce0fa5b3a070d0b4f403 Mon Sep 17 00:00:00 2001 From: Shunya Shishido Date: Mon, 3 Mar 2025 16:11:10 +0900 Subject: [PATCH 1/9] Support ServiceWorkerAutoPreload behavior --- docs/index.bs | 59 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index bf094df7..f0d6bd3c 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3228,6 +3228,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Let |shouldSoftUpdate| be true if any of the following are true, and false otherwise: * |request| is a [=non-subresource request=]. * |request| is a [=subresource request=] and |registration| is [=stale=]. + 1. Let |raceResponse| be null. 1. If |activeWorker|'s [=service worker/list of router rules=] [=list/is not empty=]: 1. Set |timingInfo|’s [=service worker timing info/worker router evaluation start=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|. 1. Let |source| be the result of running the [=Get Router Source=] algorithm with |registration|'s active worker and |request|. @@ -3287,29 +3288,43 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Set |routedResponse|'s [=service worker timing info=]'s [=service worker timing info/worker final router source=] be set to |result|'s [=race result/used route=]. 1. Return |routedResponse|. 1. Assert: |source| is "{{RouterSourceEnum/fetch-event}}" - 1. If |request| is a [=navigation request=], |registration|'s [=navigation preload enabled flag=] is set, |request|'s [=request/method=] is \`GET\`, |registration|'s [=active worker=]'s [=set of event types to handle=] [=set/contains=] fetch, and |registration|'s [=active worker=]'s [=all fetch listeners are empty flag=] is not set then: - - Note: If the above is true except |registration|'s [=active worker=]'s set of event types to handle **does not** contain fetch, then the user agent may wish to show a console warning, as the developer's intent isn't clear. - - 1. Let |preloadRequest| be the result of [=request/cloning=] the request |request|. - 1. Let |preloadRequestHeaders| be |preloadRequest|'s [=request/header list=]. - 1. Let |preloadResponseObject| be a new {{Response}} object associated with a new {{Headers}} object whose [=guard=] is "`immutable`". - 1. [=header list/Append=] to |preloadRequestHeaders| a new [=header=] whose [=header/name=] is \`Service-Worker-Navigation-Preload\` and [=header/value=] is |registration|'s [=navigation preload header value=]. - 1. Set |preloadRequest|'s [=service-workers mode=] to "`none`". - 1. Let |preloadFetchController| be null. - 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": - 1. Set |preloadFetchController| to the result of [=Fetch|fetching=] |preloadRequest|. - - To [=fetch/processResponse=] for |navigationPreloadResponse|, run these substeps: - - 1. If |navigationPreloadResponse|'s [=response/type=] is "`error`", reject |preloadResponse| with a `TypeError` and terminate these substeps. - 1. Associate |preloadResponseObject| with |navigationPreloadResponse|. - 1. Resolve |preloadResponse| with |preloadResponseObject|. - 1. [=If aborted=], then: - 1. Let |deserializedError| be the result of [=deserialize a serialized abort reason=] given null and |workerRealm|. - 1. [=fetch controller/Abort=] |preloadFetchController| with |deserializedError|. + 1. If |request| is a [=navigation request=], |request|'s [=request/method=] is \`GET\`, |registration|'s [=active worker=]'s [=set of event types to handle=] [=set/contains=] fetch, and |registration|'s [=active worker=]'s [=all fetch listeners are empty flag=] is not set then: + 1. If |registration|'s [=navigation preload enabled flag=] is set then: + + Note: If the above is true except |registration|'s [=active worker=]'s set of event types to handle **does not** contain fetch, then the user agent may wish to show a console warning, as the developer's intent isn't clear. + + 1. Let |preloadRequest| be the result of [=request/cloning=] the request |request|. + 1. Let |preloadRequestHeaders| be |preloadRequest|'s [=request/header list=]. + 1. Let |preloadResponseObject| be a new {{Response}} object associated with a new {{Headers}} object whose [=guard=] is "`immutable`". + 1. [=header list/Append=] to |preloadRequestHeaders| a new [=header=] whose [=header/name=] is \`Service-Worker-Navigation-Preload\` and [=header/value=] is |registration|'s [=navigation preload header value=]. + 1. Set |preloadRequest|'s [=service-workers mode=] to "`none`". + 1. Let |preloadFetchController| be null. + 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": + 1. Set |preloadFetchController| to the result of [=Fetch|fetching=] |preloadRequest|. + + To [=fetch/processResponse=] for |navigationPreloadResponse|, run these substeps: + + 1. If |navigationPreloadResponse|'s [=response/type=] is "`error`", reject |preloadResponse| with a `TypeError` and terminate these substeps. + 1. Associate |preloadResponseObject| with |navigationPreloadResponse|. + 1. Resolve |preloadResponse| with |preloadResponseObject|. + 1. [=If aborted=], then: + 1. Let |deserializedError| be the result of [=deserialize a serialized abort reason=] given null and |workerRealm|. + 1. [=fetch controller/Abort=] |preloadFetchController| with |deserializedError|. + 1. Else, a user agent may run the following substeps: + + Note: A user agent may speculatively dispatch a network request in parallel with creating a fetch event in order to minimize the bootstrap cost. + + 1. Let |autoPreloadFetchController| be null. + 1. Set |raceResponse| to be a [=race response=] whose [=race response/value=] is "pending". + 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": + 1. Set |autoPreloadFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |autoPreloadRequestResponse|: + 1. If |autoPreloadRequestResponse|'s [=response/status=] is [=ok status=], set |raceResponse|'s [=race response/value=] to |autoPreloadRequestResponse|. + 1. [=If aborted=] and |autoPreloadFetchController| is not null, then: + 1. [=fetch controller/Abort=] |autoPreloadFetchController|. + 1. Set |raceResponse| to a [=race response=] whose [=race response/value=] is null. + 1. Resolve |preloadResponse| with undefined. 1. Else, resolve |preloadResponse| with undefined. - 1. Let |fetchResult| be the result of [=Create Fetch Event and Dispatch=] with |request|, |registration|, |useHighResPerformanceTimers|, |timingInfo|, |workerRealm|, |reservedClient|, |preloadResponse|, and null. + 1. Let |fetchResult| be the result of [=Create Fetch Event and Dispatch=] with |request|, |registration|, |useHighResPerformanceTimers|, |timingInfo|, |workerRealm|, |reservedClient|, |preloadResponse|, and |raceResponse|. 1. If |timingInfo|'s [=service worker timing info/worker final router source=] is not an empty string: 1. Assert |timingInfo|'s [=service worker timing info/worker final router source=] is {{RouterSourceEnum/"network"}}. 1. If |fetchResult| is null, then return |timingInfo|. From dd2b26bdd284df1e6e6e32eddd7ce3e5f43bb4d4 Mon Sep 17 00:00:00 2001 From: Shunya Shishido Date: Tue, 10 Jun 2025 16:29:25 +0900 Subject: [PATCH 2/9] Add opt-out condition --- docs/index.bs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index f0d6bd3c..017e1254 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3229,9 +3229,10 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ * |request| is a [=non-subresource request=]. * |request| is a [=subresource request=] and |registration| is [=stale=]. 1. Let |raceResponse| be null. + 1. Let |source| be null. 1. If |activeWorker|'s [=service worker/list of router rules=] [=list/is not empty=]: 1. Set |timingInfo|’s [=service worker timing info/worker router evaluation start=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|. - 1. Let |source| be the result of running the [=Get Router Source=] algorithm with |registration|'s active worker and |request|. + 1. Set |source| to be the result of running the [=Get Router Source=] algorithm with |registration|'s active worker and |request|. 1. If |source| is non-null, then: 1. Set |timingInfo|'s [=service worker timing info/worker matched router source=] be set to |source|, and [=service worker timing info/worker final router source=] be set to {{RouterSourceEnum/"network"}}. 1. If |source| is {{RouterSourceEnum/"network"}}: @@ -3310,7 +3311,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. [=If aborted=], then: 1. Let |deserializedError| be the result of [=deserialize a serialized abort reason=] given null and |workerRealm|. 1. [=fetch controller/Abort=] |preloadFetchController| with |deserializedError|. - 1. Else, a user agent may run the following substeps: + 1. Else if |source| is not "{{RouterSourceEnum/fetch-event}}", a user agent may run the following substeps: Note: A user agent may speculatively dispatch a network request in parallel with creating a fetch event in order to minimize the bootstrap cost. From b1f4c5a9e7933ba20497c2db8bafb0e52dffce7b Mon Sep 17 00:00:00 2001 From: Shunya Shishido Date: Tue, 17 Jun 2025 10:55:41 +0900 Subject: [PATCH 3/9] Move `raceResponse` to narrow down the scope --- docs/index.bs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index d86d30ac..471f1012 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3228,7 +3228,6 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Let |shouldSoftUpdate| be true if any of the following are true, and false otherwise: * |request| is a [=non-subresource request=]. * |request| is a [=subresource request=] and |registration| is [=stale=]. - 1. Let |raceResponse| be null. 1. Let |source| be null. 1. If |activeWorker|'s [=service worker/list of router rules=] [=list/is not empty=]: 1. Set |timingInfo|’s [=service worker timing info/worker router evaluation start=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|. @@ -3317,7 +3316,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ Note: A user agent may speculatively dispatch a network request in parallel with creating a fetch event in order to minimize the bootstrap cost. 1. Let |autoPreloadFetchController| be null. - 1. Set |raceResponse| to be a [=race response=] whose [=race response/value=] is "pending". + 1. Let |raceResponse| be a [=race response=] whose [=race response/value=] is "pending". 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": 1. Set |autoPreloadFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |autoPreloadRequestResponse|: 1. If |autoPreloadRequestResponse|'s [=response/status=] is [=ok status=], set |raceResponse|'s [=race response/value=] to |autoPreloadRequestResponse|. From 89fdc14080d79b8d8dd5497004b0ec4e8975514d Mon Sep 17 00:00:00 2001 From: Shunya Shishido Date: Tue, 17 Jun 2025 11:00:15 +0900 Subject: [PATCH 4/9] Restore raceResponse --- docs/index.bs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index 471f1012..7feca7c6 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3228,6 +3228,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Let |shouldSoftUpdate| be true if any of the following are true, and false otherwise: * |request| is a [=non-subresource request=]. * |request| is a [=subresource request=] and |registration| is [=stale=]. + 1. Let |raceResponse| be null. 1. Let |source| be null. 1. If |activeWorker|'s [=service worker/list of router rules=] [=list/is not empty=]: 1. Set |timingInfo|’s [=service worker timing info/worker router evaluation start=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|. @@ -3263,7 +3264,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. If |shouldSoftUpdate| is true, then [=in parallel=] run the [=Soft Update=] algorithm with |registration|. 1. Let |queue| be an empty [=queue=] of [=race result=]. 1. Let |raceFetchController| be null. - 1. Let |raceResponse| be a [=race response=] whose [=race response/value=] is "pending". + 1. Set |raceResponse| to be a [=race response=] whose [=race response/value=] is "pending". 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": 1. Set |raceFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |raceNetworkRequestResponse|: 1. Set |raceResponse|'s [=race response/value=] to |raceNetworkRequestResponse|. @@ -3316,7 +3317,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ Note: A user agent may speculatively dispatch a network request in parallel with creating a fetch event in order to minimize the bootstrap cost. 1. Let |autoPreloadFetchController| be null. - 1. Let |raceResponse| be a [=race response=] whose [=race response/value=] is "pending". + 1. Set |raceResponse| to be a [=race response=] whose [=race response/value=] is "pending". 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": 1. Set |autoPreloadFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |autoPreloadRequestResponse|: 1. If |autoPreloadRequestResponse|'s [=response/status=] is [=ok status=], set |raceResponse|'s [=race response/value=] to |autoPreloadRequestResponse|. From 06eeb47517ad0d33987588694e84a57591d1e27e Mon Sep 17 00:00:00 2001 From: Shunya Shishido Date: Tue, 17 Jun 2025 14:24:41 +0900 Subject: [PATCH 5/9] Rename raceResponse to responseForAutoPreload --- docs/index.bs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index 7feca7c6..baa2d832 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3228,7 +3228,6 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Let |shouldSoftUpdate| be true if any of the following are true, and false otherwise: * |request| is a [=non-subresource request=]. * |request| is a [=subresource request=] and |registration| is [=stale=]. - 1. Let |raceResponse| be null. 1. Let |source| be null. 1. If |activeWorker|'s [=service worker/list of router rules=] [=list/is not empty=]: 1. Set |timingInfo|’s [=service worker timing info/worker router evaluation start=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|. @@ -3264,7 +3263,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. If |shouldSoftUpdate| is true, then [=in parallel=] run the [=Soft Update=] algorithm with |registration|. 1. Let |queue| be an empty [=queue=] of [=race result=]. 1. Let |raceFetchController| be null. - 1. Set |raceResponse| to be a [=race response=] whose [=race response/value=] is "pending". + 1. Let |raceResponse| be a [=race response=] whose [=race response/value=] is "pending". 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": 1. Set |raceFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |raceNetworkRequestResponse|: 1. Set |raceResponse|'s [=race response/value=] to |raceNetworkRequestResponse|. @@ -3290,6 +3289,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Set |routedResponse|'s [=service worker timing info=]'s [=service worker timing info/worker final router source=] be set to |result|'s [=race result/used route=]. 1. Return |routedResponse|. 1. Assert: |source| is "{{RouterSourceEnum/fetch-event}}" + 1. Let |responseForAutoPreload| be null. 1. If |request| is a [=navigation request=], |request|'s [=request/method=] is \`GET\`, |registration|'s [=active worker=]'s [=set of event types to handle=] [=set/contains=] fetch, and |registration|'s [=active worker=]'s [=all fetch listeners are empty flag=] is not set then: 1. If |registration|'s [=navigation preload enabled flag=] is set then: @@ -3317,16 +3317,16 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ Note: A user agent may speculatively dispatch a network request in parallel with creating a fetch event in order to minimize the bootstrap cost. 1. Let |autoPreloadFetchController| be null. - 1. Set |raceResponse| to be a [=race response=] whose [=race response/value=] is "pending". + 1. Set |responseForAutoPreload| to be a [=race response=] whose [=race response/value=] is "pending". 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": 1. Set |autoPreloadFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |autoPreloadRequestResponse|: - 1. If |autoPreloadRequestResponse|'s [=response/status=] is [=ok status=], set |raceResponse|'s [=race response/value=] to |autoPreloadRequestResponse|. + 1. If |autoPreloadRequestResponse|'s [=response/status=] is [=ok status=], set |responseForAutoPreload|'s [=race response/value=] to |autoPreloadRequestResponse|. 1. [=If aborted=] and |autoPreloadFetchController| is not null, then: 1. [=fetch controller/Abort=] |autoPreloadFetchController|. - 1. Set |raceResponse| to a [=race response=] whose [=race response/value=] is null. + 1. Set |responseForAutoPreload| to a [=race response=] whose [=race response/value=] is null. 1. Resolve |preloadResponse| with undefined. 1. Else, resolve |preloadResponse| with undefined. - 1. Let |fetchResult| be the result of [=Create Fetch Event and Dispatch=] with |request|, |registration|, |useHighResPerformanceTimers|, |timingInfo|, |workerRealm|, |reservedClient|, |preloadResponse|, and |raceResponse|. + 1. Let |fetchResult| be the result of [=Create Fetch Event and Dispatch=] with |request|, |registration|, |useHighResPerformanceTimers|, |timingInfo|, |workerRealm|, |reservedClient|, |preloadResponse|, and |responseForAutoPreload|. 1. If |timingInfo|'s [=service worker timing info/worker final router source=] is not an empty string: 1. Assert |timingInfo|'s [=service worker timing info/worker final router source=] is {{RouterSourceEnum/"network"}}. 1. If |fetchResult| is null, then return |timingInfo|. From d436dce13b9a44f92361a222a9e92695386e3a15 Mon Sep 17 00:00:00 2001 From: Shunya Shishido Date: Tue, 17 Jun 2025 15:24:52 +0900 Subject: [PATCH 6/9] Remove |source| --- docs/index.bs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index baa2d832..97cbc2d0 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3228,10 +3228,9 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Let |shouldSoftUpdate| be true if any of the following are true, and false otherwise: * |request| is a [=non-subresource request=]. * |request| is a [=subresource request=] and |registration| is [=stale=]. - 1. Let |source| be null. 1. If |activeWorker|'s [=service worker/list of router rules=] [=list/is not empty=]: 1. Set |timingInfo|’s [=service worker timing info/worker router evaluation start=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|. - 1. Set |source| to be the result of running the [=Get Router Source=] algorithm with |registration|'s active worker and |request|. + 1. Let |source| be the result of running the [=Get Router Source=] algorithm with |registration|'s active worker and |request|. 1. If |source| is non-null, then: 1. Set |timingInfo|'s [=service worker timing info/worker matched router source=] be set to |source|, and [=service worker timing info/worker final router source=] be set to {{RouterSourceEnum/"network"}}. 1. If |source| is {{RouterSourceEnum/"network"}}: @@ -3312,7 +3311,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. [=If aborted=], then: 1. Let |deserializedError| be the result of [=deserialize a serialized abort reason=] given null and |workerRealm|. 1. [=fetch controller/Abort=] |preloadFetchController| with |deserializedError|. - 1. Else if |source| is not "{{RouterSourceEnum/fetch-event}}", a user agent may run the following substeps: + 1. Else if |timingInfo|'s [=service worker timing info/worker matched router source=] is not "{{RouterSourceEnum/fetch-event}}", a user agent may run the following substeps: Note: A user agent may speculatively dispatch a network request in parallel with creating a fetch event in order to minimize the bootstrap cost. From c2070a701f90f5156f436d9b89f7a7ad36e59190 Mon Sep 17 00:00:00 2001 From: Shunya Shishido Date: Thu, 19 Jun 2025 15:35:46 +0900 Subject: [PATCH 7/9] Set the response to responseForAutoPreload regardless of the status --- docs/index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.bs b/docs/index.bs index 97cbc2d0..abf744c9 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3319,7 +3319,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Set |responseForAutoPreload| to be a [=race response=] whose [=race response/value=] is "pending". 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": 1. Set |autoPreloadFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |autoPreloadRequestResponse|: - 1. If |autoPreloadRequestResponse|'s [=response/status=] is [=ok status=], set |responseForAutoPreload|'s [=race response/value=] to |autoPreloadRequestResponse|. + 1. Set |responseForAutoPreload|'s [=race response/value=] to |autoPreloadRequestResponse|. 1. [=If aborted=] and |autoPreloadFetchController| is not null, then: 1. [=fetch controller/Abort=] |autoPreloadFetchController|. 1. Set |responseForAutoPreload| to a [=race response=] whose [=race response/value=] is null. From 74b9dc4c633efeda219b28649cc88e90193c3d5c Mon Sep 17 00:00:00 2001 From: Shunya Shishido Date: Mon, 7 Jul 2025 17:47:24 +0900 Subject: [PATCH 8/9] Add null assertion --- docs/index.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.bs b/docs/index.bs index abf744c9..b04f3de9 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3315,6 +3315,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ Note: A user agent may speculatively dispatch a network request in parallel with creating a fetch event in order to minimize the bootstrap cost. + 1. Assert: [=service worker timing info/worker matched router source=] is null. 1. Let |autoPreloadFetchController| be null. 1. Set |responseForAutoPreload| to be a [=race response=] whose [=race response/value=] is "pending". 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": From 3daef7162c8c0f1e19145b75f3c0a29d0aa1fb20 Mon Sep 17 00:00:00 2001 From: Shunya Shishido Date: Mon, 28 Jul 2025 12:15:30 +0900 Subject: [PATCH 9/9] Add timingInfo, intent --- docs/index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index b04f3de9..24f4175f 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3315,12 +3315,12 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ Note: A user agent may speculatively dispatch a network request in parallel with creating a fetch event in order to minimize the bootstrap cost. - 1. Assert: [=service worker timing info/worker matched router source=] is null. + 1. Assert: |timingInfo|'s [=service worker timing info/worker matched router source=] is null. 1. Let |autoPreloadFetchController| be null. 1. Set |responseForAutoPreload| to be a [=race response=] whose [=race response/value=] is "pending". 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": 1. Set |autoPreloadFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |autoPreloadRequestResponse|: - 1. Set |responseForAutoPreload|'s [=race response/value=] to |autoPreloadRequestResponse|. + 1. Set |responseForAutoPreload|'s [=race response/value=] to |autoPreloadRequestResponse|. 1. [=If aborted=] and |autoPreloadFetchController| is not null, then: 1. [=fetch controller/Abort=] |autoPreloadFetchController|. 1. Set |responseForAutoPreload| to a [=race response=] whose [=race response/value=] is null.