Re: [w3c/ServiceWorker] Add an option to include frozen documents. (#1442)

jakearchibald requested changes on this pull request.



> @@ -66,6 +66,10 @@ spec: page-visibility; urlPrefix: https://www.w3.org/TR/page-visibility/

     type: enum; text: VisibilityState; url: VisibilityState
     type: attribute; text: visibilityState; for: Document; url: dom-document-visibilitystate
 
+spec: page-lifecycle; urlPrefix: https://wicg.github.io/page-lifecycle/spec.html

+    type: dfn; text: frozen; url: frozen
+    type: dfn; text: owning document; url: dedicatedworkerglobalscope-owning-document

@tabatkins can we get https://wicg.github.io/page-lifecycle/spec.html added to bikeshed's database?

> @@ -1050,6 +1055,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe

 
     A {{Client}} object has an associated <dfn id="dfn-service-worker-client-frame-type" for="Client">frame type</dfn>, which is one of "`auxiliary`", "`top-level`", "`nested`", and "`none`". Unless stated otherwise it is "`none`".
 
+    A {{Client}} object has an associated <dfn id="dfn-service-worker-client-frozen" for="Client">frozen state</dfn>, which if a {{WindowClient}} should reflect [=Client/service worker client=]'s [=responsible document=] [=frozen=] state, otherwise it should reflect [=Client/service worker client=]'s [=environment settings object/global object=]'s [=owning document=] [=frozen=] state.

`Client` objects are snapshots of state – their values never update.

* Change this to a simple boolean.
* Add a getter.
* Update Create Client and Create Window Client to set the *frozen* value.
* Update Create Client and Create Window Client call sites to provide the correct frozen value (similar to what you're currently doing above).

https://w3c.github.io/ServiceWorker/#dfn-service-worker-client-focusstate might be a good reference for how this should work.

> @@ -1248,6 +1256,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe

                 1. If |client|'s [=environment/execution ready flag=] is unset or |client|'s [=discarded flag=] is set, [=continue=].
                 1. If |client| is not a [=secure context=], [=continue=].
                 1. If |options|["{{ClientQueryOptions/includeUncontrolled}}"] is false, and if |client|'s [=active service worker=] is not the associated [=ServiceWorkerGlobalScope/service worker=], [=continue=].
+                1. If |options|["{{ClientQueryOptions/includeFrozen}}"] is false, |client| is {{Client/frozen}}, [=continue=].

`|client|` is a `[=service worker client=]`, not a `{{Client}}`, so `{{Client/frozen}}` doesn't make sense here.

At this point you need to determine if the client is actually frozen or not. Also, be wary of race conditions here. Ensure that, if `includeFrozen` is false, no frozen clients are returned.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1442#pullrequestreview-255070201

Received on Thursday, 27 June 2019 08:37:14 UTC