Skip to content

Commit 1317558

Browse files
committed
uncontrol clients no longer matches by the active scope
1 parent 3428c08 commit 1317558

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

docs/index.bs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
122122
}
123123
</pre>
124124

125-
<!-- TODO: uncontrol old clients that no longer match in Activate -->
126-
127125
<section>
128126
<h2 id="motivations">Motivations</h2>
129127

@@ -2865,6 +2863,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
28652863
1. If |registration|'s [=active worker=] is not null, then:
28662864
1. [=Terminate Service Worker|Terminate=] |registration|'s [=active worker=].
28672865
1. Run the [=Update Worker State=] algorithm passing |registration|'s [=active worker=] and "`redundant`" as the arguments.
2866+
1. Let |oldUsingClients| be a [=list=] of [=/service worker clients=] who are <a>using</a> |registration|.
2867+
2868+
Note: We must get the list of clients prior to clearing the old <a>active worker</a> from |registration|. Otherwise the [=/service worker client=] will not be considered to be <a>using</a> |registration| any more since |registration| will no longer be the <a>containing service worker registration</a>.
2869+
28682870
1. Run the <a>Update Registration State</a> algorithm passing |registration|, "<code>active</code>" and |registration|'s <a>waiting worker</a> as the arguments.
28692871
1. Run the <a>Update Registration State</a> algorithm passing |registration|, "<code>waiting</code>" and null as the arguments.
28702872
1. Run the <a>Update Worker State</a> algorithm passing |registration|'s <a>active worker</a> and "`activating`" as the arguments.
@@ -2884,9 +2886,12 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
28842886

28852887
Note: Resources will now use the service worker registration instead of the existing application cache.
28862888

2887-
1. For each [=/service worker client=] |client| who is <a>using</a> |registration|:
2888-
1. Set |client|'s <a>active worker</a> to |registration|'s <a>active worker</a>.
2889-
1. Invoke <a>Notify Controller Change</a> algorithm with |client| as the argument.
2889+
1. [=list/For each=] |oldClient| of |oldUsingClients|:
2890+
1. If |oldClient|'s <a>creation URL</a> <a lt="Match Service Worker Registration">matches</a> |registration|'s [=active worker=]'s [=service worker/scope url=], then:
2891+
1. Set |client|'s <a>active worker</a> to |registration|'s <a>active worker</a>.
2892+
1. Else:
2893+
1. Set |oldClient|'s <a>active worker</a> to null.
2894+
1. Invoke <a>Notify Controller Change</a> algorithm with |oldClient| as the argument.
28902895
1. Let |activeWorker| be |registration|'s <a>active worker</a>.
28912896
1. If the result of running the [=Should Skip Event=] algorithm with |activeWorker| and "activate" is false, then:
28922897
1. If the result of running the [=Run Service Worker=] algorithm with |activeWorker| is not *failure*, then:

0 commit comments

Comments
 (0)