From 131b591b963aecacfd7784cac2698ca88b42a435 Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Thu, 12 Jun 2025 07:57:48 +0000 Subject: [PATCH 1/6] More easy to abort --- docs/index.bs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/index.bs b/docs/index.bs index b073ac13..3a1ed7d6 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3263,9 +3263,11 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 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. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": + 1. Let |fetchControllerAborted| be false. + 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchControllerAborted| is true: 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|. + 1. If |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted", then |fetchControllerAborted| is true. 1. If |raceNetworkRequestResponse|'s [=response/status=] is [=ok status=], then: 1. Let |raceNetworkResult| be a [=race result=] whose [=race result/routed response=] is |raceNetworkRequestResponse| and [=race result/used route=] is {{RouterSourceEnum/"network"}}. 1. [=queue/Enqueue=] |raceNetworkResult| to |queue|. From 17ba801952df1cba1a9cca254a653aaf72187f6d Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Thu, 12 Jun 2025 08:26:45 +0000 Subject: [PATCH 2/6] abort steps upon the |fetchController| state. --- docs/index.bs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index 3a1ed7d6..308bad70 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3263,8 +3263,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 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. Let |fetchControllerAborted| be false. - 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchControllerAborted| is true: + 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|. 1. If |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted", then |fetchControllerAborted| is true. From 48750fed03ede4010f8653eb1701aa1e4fd1c170 Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Thu, 12 Jun 2025 09:02:36 +0000 Subject: [PATCH 3/6] also add the step to navigation preload --- docs/index.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.bs b/docs/index.bs index 308bad70..19c1b74b 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3304,6 +3304,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ To [=fetch/processResponse=] for |navigationPreloadResponse|, run these substeps: + 1. If |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted", abort these steps. 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|. From ed117fdee742b1eda8177012615e173d0d4d8c67 Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Fri, 13 Jun 2025 06:39:02 +0000 Subject: [PATCH 4/6] Updated --- docs/index.bs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index 19c1b74b..6a02c3a2 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3263,16 +3263,17 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 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. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": + 1. Run the following substeps [=in parallel=]: + 1. If |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted", then set |raceResponse| to a [=race response=] whose [=race response/value=] is null, and abort these steps. 1. Set |raceFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |raceNetworkRequestResponse|: + 1. [=Abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted". 1. Set |raceResponse|'s [=race response/value=] to |raceNetworkRequestResponse|. - 1. If |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted", then |fetchControllerAborted| is true. 1. If |raceNetworkRequestResponse|'s [=response/status=] is [=ok status=], then: 1. Let |raceNetworkResult| be a [=race result=] whose [=race result/routed response=] is |raceNetworkRequestResponse| and [=race result/used route=] is {{RouterSourceEnum/"network"}}. 1. [=queue/Enqueue=] |raceNetworkResult| to |queue|. - 1. [=If aborted=] and |raceFetchController| is not null, then: - 1. [=fetch controller/Abort=] |raceFetchController|. - 1. Set |raceResponse| to a [=race response=] whose [=race response/value=] is null. + 1. [=If aborted=] and |raceFetchController| is not null, then: + 1. [=fetch controller/Abort=] |raceFetchController|. + 1. Set |raceResponse| to a [=race response=] whose [=race response/value=] is null. 1. Resolve |preloadResponse| with undefined. 1. Run the following substeps [=in parallel=]: 1. Let |fetchHandlerResponse| be the result of [=Create Fetch Event and Dispatch=] with |request|, |registration|, |useHighResPerformanceTimers|, |timingInfo|, |workerRealm|, |reservedClient|, |preloadResponse|, and |raceResponse|. @@ -3304,7 +3305,6 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ To [=fetch/processResponse=] for |navigationPreloadResponse|, run these substeps: - 1. If |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted", abort these steps. 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|. From 169a23252752537e0a6e9fc5bb3c4403e000fb36 Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Wed, 18 Jun 2025 05:15:36 +0000 Subject: [PATCH 5/6] revise the sentence --- docs/index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.bs b/docs/index.bs index 6a02c3a2..f8d7e6a4 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3266,7 +3266,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Run the following substeps [=in parallel=]: 1. If |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted", then set |raceResponse| to a [=race response=] whose [=race response/value=] is null, and abort these steps. 1. Set |raceFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |raceNetworkRequestResponse|: - 1. [=Abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted". + 1. Run these steps, but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted". 1. Set |raceResponse|'s [=race response/value=] to |raceNetworkRequestResponse|. 1. If |raceNetworkRequestResponse|'s [=response/status=] is [=ok status=], then: 1. Let |raceNetworkResult| be a [=race result=] whose [=race result/routed response=] is |raceNetworkRequestResponse| and [=race result/used route=] is {{RouterSourceEnum/"network"}}. From 153f7fb03900e5355918cb47a26fe8f1d7430ff7 Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Wed, 18 Jun 2025 05:17:40 +0000 Subject: [PATCH 6/6] minor fix --- docs/index.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index f8d7e6a4..22d83b0d 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3267,10 +3267,10 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. If |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted", then set |raceResponse| to a [=race response=] whose [=race response/value=] is null, and abort these steps. 1. Set |raceFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |raceNetworkRequestResponse|: 1. Run these steps, but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted". - 1. Set |raceResponse|'s [=race response/value=] to |raceNetworkRequestResponse|. - 1. If |raceNetworkRequestResponse|'s [=response/status=] is [=ok status=], then: - 1. Let |raceNetworkResult| be a [=race result=] whose [=race result/routed response=] is |raceNetworkRequestResponse| and [=race result/used route=] is {{RouterSourceEnum/"network"}}. - 1. [=queue/Enqueue=] |raceNetworkResult| to |queue|. + 1. Set |raceResponse|'s [=race response/value=] to |raceNetworkRequestResponse|. + 1. If |raceNetworkRequestResponse|'s [=response/status=] is [=ok status=], then: + 1. Let |raceNetworkResult| be a [=race result=] whose [=race result/routed response=] is |raceNetworkRequestResponse| and [=race result/used route=] is {{RouterSourceEnum/"network"}}. + 1. [=queue/Enqueue=] |raceNetworkResult| to |queue|. 1. [=If aborted=] and |raceFetchController| is not null, then: 1. [=fetch controller/Abort=] |raceFetchController|. 1. Set |raceResponse| to a [=race response=] whose [=race response/value=] is null.