diff --git a/prefetch.bs b/prefetch.bs index a151fe4..cd5e4e9 100644 --- a/prefetch.bs +++ b/prefetch.bs @@ -121,6 +121,8 @@ spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/ text: anonymization policy; url: sl-candidate-anonymization-policy for: speculative load candidate text: URL; url: sl-candidate-url + urlPrefix: webappapis.html + text: navigation and traversal task source spec: fetch; urlPrefix: https://fetch.spec.whatwg.org/ type: dfn text: network partition key; url: network-partition-key @@ -780,6 +782,33 @@ This section contains patches to [[NAVIGATION-TIMING]]. This section contains patches to [[SERVICE-WORKERS]]. +
+ Modify the definition of controlled as follows: + +
+ When a [=service worker client=] has a non-null [=environment/active service worker=] whose [=environment/is navigational prefetch client=] is false, it is said to be controlled by that [=environment/active service worker=]. +
+
+ +
+ Modify the Update algorithm by changing the final step as follows: + + 1. Else, + 1. Let |clients| be all [=service worker clients=] whose [=environment/active service worker=] is |worker|. + 1. [=list/For each=] |client| of |clients|: + 1. If |client| is not an [=environment settings object=], then [=iteration/continue=]. + 1. If |client|'s [=environment settings object/global object=] is not a {{Window}} object, then [=iteration/continue=]. + 1. [=Queue a global task=] on the [=navigation and traversal task source=] given |client|'s [=environment settings object/global object=] to perform the following steps: + 1. Let |document| be |client|'s [=environment settings object/global object=]'s [=associated Document=]. + 1. [=list/For each=] |prefetchRecord| of |document|'s [=Document/prefetch records=]: + 1. [=prefetch record/Cancel and discard=] |prefetchRecord| given |document|. + +

Clearing prefetch records in this way avoids a situation where a prefetched response was fetched with the pre-update service worker (newestWorker), but then the navigation results in a client that is controlled by the post-update service worker (|worker|), which could have unexpected consequences for the web developer.

+ 1. Invoke Install with job, |worker|, and registration. +
+ +
+
Modify Create Fetch Event and Dispatch's step which sets {{FetchEvent/resultingClientId}} as follows: