You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clean up Client API to not expose reserved clients (#1259)
To reflect the decision to not expose reserved clients
(#1216) and to spec
.resultingClientId and .targetClientId in Nightly only, this:
* Removes
- Client.reserved and its associated reserved state (V1, Nightly)
- ClientQueryOptions.includeReserved (V1, Nightly)
- FetchEvent.reservedClientId (V1)
- FetchEvent.targetClientId (V1)
- FetchEventInit.reservedClientId (V1)
- FetchEventInit.targetClientId (V1)
* Changes
- FetchEvent.reservedClientId to FetchEvent.resultingClientId (Nightly)
- FetchEventInit.reservedClientId to FetchEventInit.resultingClientId
(Nightly)
- Handle Fetch to set FetchEvent.clientId for a navigation request to
the empty string (V1)
* Corrects
- matchedClients with clientObjects in Clients.matchAll() (V1, Nightly)
Related issue: #1245.
This also cleans up sort condition steps in Clients.matchAll() that
fixes#1080 (V1, Nightly)
(Changes for the Clients interface's methods will be addressed as
separate PRs.)
A {{Client}} object has an associated <dfn for="Client">service worker client</dfn> (a [=/service worker client=]).
990
990
991
-
A {{Client}} object has an associated <dfn for="Client">reserved state</dfn>, which is either true or false.
991
+
A {{WindowClient}} object has an associated <dfn id="dfn-service-worker-client-browsing-context" for="WindowClient">browsing context</dfn>, which is its [=Client/service worker client=]'s [=environment settings object/global object=]'s [=/browsing context=].
992
992
993
993
A {{WindowClient}} object has an associated <dfn id="dfn-service-worker-client-visibilitystate">visibility state</dfn>, which is one of {{Document/visibilityState}} attribute value.
1. If |client|’s [=creation URL=] is not a [=potentially trustworthy URL=], [=continue=].
1205
1198
1. If |options|["{{ClientQueryOptions/includeUncontrolled}}"] is false, and if |client|'s [=active service worker=] is not the associated [=ServiceWorkerGlobalScope/service worker=], [=continue=].
1206
-
1. If |options|["{{ClientQueryOptions/includeReserved}}"] is false, and if |client|'s [=environment/execution ready flag=] is unset, [=continue=].
1199
+
1. If |client|'s [=environment/execution ready flag=] is unset, [=continue=].
1. [=list/For each=] |client| in |matchedClients|:
1237
1230
1. Let |clientObject| be the result of running [=Create Client=] algorithm with |client| as the argument.
1238
1231
1. [=Append=] |clientObject| to |clientObjects|.
1239
-
1. Sort |matchedClients| such that:
1240
-
* {{WindowClient}} objects are always placed before {{Client}} objects whose associated [=Client/service worker clients=] are [=worker clients=].
1241
-
* {{WindowClient}} objects that have been [=focusing steps|focused=] are placed first sorted in the most recently [=focusing steps|focused=] order, and {{WindowClient}} objects that have never been [=focusing steps|focused=] are placed next sorted in their [=Client/service worker clients=]' creation order.
1242
-
* {{Client}} objects whose associated [=Client/service worker clients=] are [=worker clients=] are placed next sorted in their [=Client/service worker clients=]' creation order.
1232
+
1. Sort |clientObjects| such that:
1233
+
* {{WindowClient}} objects whose [=WindowClient/browsing context=] has been [=focusing steps|focused=] are placed first, sorted in the most recently [=focusing steps|focused=] order.
1234
+
* {{WindowClient}} objects whose [=WindowClient/browsing context=] has never been [=focusing steps|focused=] are placed next, sorted in their [=Client/service worker client=]'s creation order.
1235
+
* {{Client}} objects whose associated [=Client/service worker client=] is a [=worker client=] are placed next, sorted in their [=Client/service worker client=]'s creation order.
1236
+
1237
+
Note: [=Window clients=] are always placed before [=worker clients=].
1238
+
1243
1239
1. [=Resolve=] |promise| with [=create a frozen array|a new frozen array of=] |clientObjects| in |promise|'s [=relevant Realm=].
<dfn attribute for="FetchEvent"><code>reservedClientId</code></dfn> attribute *must* return the value it was initialized to. When an <a>event</a> is created the attribute *must* be initialized to the empty string.
1407
+
<dfn attribute for="FetchEvent"><code>resultingClientId</code></dfn> attribute *must* return the value it was initialized to. When an <a>event</a> is created the attribute *must* be initialized to the empty string.
1. Initialize |e|’s {{FetchEvent/request}} attribute to |requestObject|.
2742
2738
1. Initialize |e|’s {{FetchEvent/preloadResponse}} to |preloadResponse|.
2743
2739
1. Initialize |e|'s {{FetchEvent/clientId}} attribute to |client|'s [=environment/id=].
2744
-
1. If |request| is a <a>non-subresource request</a> and |request|'s [=request/destination=] is not {{RequestDestination/"report"}}, initialize |e|'s {{FetchEvent/reservedClientId}} attribute to |reservedClient|'s [=environment/id=], and to the empty string otherwise.
2740
+
1. If |request| is a <a>non-subresource request</a> and |request|'s [=request/destination=] is not {{RequestDestination/"report"}}, initialize |e|'s {{FetchEvent/resultingClientId}} attribute to |reservedClient|'s [=environment/id=], and to the empty string otherwise.
2745
2741
1. If |request| is a <a>navigation request</a>, initialize |e|'s {{FetchEvent/targetClientId}} attribute to |request|'s [=request/target client id=], and to the empty string otherwise.
2746
2742
1. <a>Dispatch</a> |e| at |activeWorker|'s [=service worker/global object=].
2747
2743
1. Invoke [=Update Service Worker Extended Events Set=] with |activeWorker| and |e|.
A {{Client}} object has an associated <dfn for="Client">service worker client</dfn> (a [=/service worker client=]).
928
928
929
-
A {{Client}} object has an associated <dfn for="Client">reserved state</dfn>, which is either true or false.
929
+
A {{WindowClient}} object has an associated <dfn id="dfn-service-worker-client-browsing-context" for="WindowClient">browsing context</dfn>, which is its [=Client/service worker client=]'s [=environment settings object/global object=]'s [=/browsing context=].
930
930
931
931
A {{WindowClient}} object has an associated <dfn id="dfn-service-worker-client-visibilitystate">visibility state</dfn>, which is one of {{Document/visibilityState}} attribute value.
1. If |client|’s [=creation URL=] is not a [=potentially trustworthy URL=], [=continue=].
1143
1136
1. If |options|["{{ClientQueryOptions/includeUncontrolled}}"] is false, and if |client|'s [=active service worker=] is not the associated [=ServiceWorkerGlobalScope/service worker=], [=continue=].
1144
-
1. If |options|["{{ClientQueryOptions/includeReserved}}"] is false, and if |client|'s [=environment/execution ready flag=] is unset, [=continue=].
1137
+
1. If |client|'s [=environment/execution ready flag=] is unset, [=continue=].
1. [=list/For each=] |client| in |matchedClients|:
1175
1168
1. Let |clientObject| be the result of running [=Create Client=] algorithm with |client| as the argument.
1176
1169
1. [=Append=] |clientObject| to |clientObjects|.
1177
-
1. Sort |matchedClients| such that:
1178
-
* {{WindowClient}} objects are always placed before {{Client}} objects whose associated [=Client/service worker clients=] are [=worker clients=].
1179
-
* {{WindowClient}} objects that have been [=focusing steps|focused=] are placed first sorted in the most recently [=focusing steps|focused=] order, and {{WindowClient}} objects that have never been [=focusing steps|focused=] are placed next sorted in their [=Client/service worker clients=]' creation order.
1180
-
* {{Client}} objects whose associated [=Client/service worker clients=] are [=worker clients=] are placed next sorted in their [=Client/service worker clients=]' creation order.
1170
+
1. Sort |clientObjects| such that:
1171
+
* {{WindowClient}} objects whose [=WindowClient/browsing context=] has been [=focusing steps|focused=] are placed first, sorted in the most recently [=focusing steps|focused=] order.
1172
+
* {{WindowClient}} objects whose [=WindowClient/browsing context=] has never been [=focusing steps|focused=] are placed next, sorted in their [=Client/service worker client=]'s creation order.
1173
+
* {{Client}} objects whose associated [=Client/service worker client=] is a [=worker client=] are placed next, sorted in their [=Client/service worker client=]'s creation order.
1174
+
1175
+
Note: [=Window clients=] are always placed before [=worker clients=].
1176
+
1181
1177
1. [=Resolve=] |promise| with [=create a frozen array|a new frozen array of=] |clientObjects| in |promise|'s [=relevant Realm=].
<dfn attribute for="FetchEvent"><code>clientId</code></dfn> attribute *must* return the value it was initialized to. When an <a>event</a> is created the attribute *must* be initialized to the empty string.
<dfn attribute for="FetchEvent"><code>reservedClientId</code></dfn> attribute *must* return the value it was initialized to. When an <a>event</a> is created the attribute *must* be initialized to the empty string.
<dfn attribute for="FetchEvent"><code>targetClientId</code></dfn> attribute *must* return the value it was initialized to. When an <a>event</a> is created the attribute *must* be initialized to the empty string.
1. Initialize |e|’s {{Event/type}} attribute to {{fetch!!event}}.
2607
2587
1. Initialize |e|’s {{Event/cancelable}} attribute to true.
2608
2588
1. Initialize |e|’s {{FetchEvent/request}} attribute to a new {{Request}} object associated with |request| and a new associated {{Headers}} object whose [=guard=] is "`immutable`".
2609
-
1. Initialize |e|'s {{FetchEvent/clientId}} attribute to |client|'s [=environment/id=].
2610
-
1. If |request| is a <a>non-subresource request</a> and |request|'s [=request/destination=] is not {{RequestDestination/"report"}}, initialize |e|'s {{FetchEvent/reservedClientId}} attribute to |reservedClient|'s [=environment/id=], and to the empty string otherwise.
2611
-
1. If |request| is a <a>navigation request</a>, initialize |e|'s {{FetchEvent/targetClientId}} attribute to |request|'s [=request/target client id=], and to the empty string otherwise.
2589
+
1. If |request| is a <a>non-subresource request</a> and |request|'s [=request/destination=] is not {{RequestDestination/"report"}}, initialize |e|'s {{FetchEvent/clientId}} attribute to the empty string, and to |client|'s [=environment/id=] otherwise.
2612
2590
1. <a>Dispatch</a> |e| at |activeWorker|'s [=service worker/global object=].
2613
2591
1. Invoke [=Update Service Worker Extended Events Set=] with |activeWorker| and |e|.
2614
2592
1. If |e|'s [=FetchEvent/respond-with entered flag=] is set, set |respondWithEntered| to true.
0 commit comments