Re: [w3c/ServiceWorker] Fix old text stating Client is a browsing context. Fixes #1083 (#1084)

wanderview commented on this pull request.



> @@ -362,7 +362,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
             1. Let the {{ExtendableMessageEvent/data}} attribute of |e| be initialized to |clonedMessage|.
             1. Let the {{ExtendableMessageEvent/origin}} attribute of |e| be initialized to the <a lt="Unicode serialization of an origin">Unicode serialization</a> of |incumbentSettings|'s [=environment settings object/origin=].
             1. If |incumbentGlobal| is a {{ServiceWorkerGlobalScope}} object, let the {{ExtendableMessageEvent/source}} attribute of |e| be initialized to a new {{ServiceWorker}} object that represents |incumbentGlobal|'s [=ServiceWorkerGlobalScope/service worker=].
-            1. Else if |incumbentGlobal| is a {{Window}} object, let the {{ExtendableMessageEvent/source}} attribute of |e| be initialized to a new {{WindowClient}} object that represents |incumbentGlobal|'s [=/browsing context=].
+            1. Else if |incumbentGlobal| is a {{Window}} object, let the {{ExtendableMessageEvent/source}} attribute of |e| be initialized to a new {{WindowClient}} object that represents |incumbentGlobal|'s [=/environment settings object=].

> Actually, I intended to describe this as the created windowClient is a thing that represents a browsing context (seems like a Window is a more relevant term?) instead of an environment settings object here because an WindowClient object captures the visual properties as well as the settings object.

I don't think this is correct.

A browsing context can have multiple environment settings objects over time as navigations occur.  Calling `document.open()` creates a new environment settings object within the browsing context.

Per my understanding of our intent is that each navigation should create a new Client object.  This suggests that the Client must be associated with the environment settings object.

The Client does have access to the visual attributes of the browsing context, but that's because the environment settings object must have a browsing context.  We get the browsing context from the environment settings object and then get the visual attributes from the browsing context.

I believe our intent and implicit in the spec is that we do not expose inactive documents or environment settings objects as Client objects.  For example, an environment settings objects in the bfcache would not be exposed.  I believe this requirement for active documents ensures there is a browsing context available.

I feel strongly at this point that the Client should represent the environment settings object and I'm not sure we can achieve our goals if we try to map it to the browsing context.

-- 
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/1084#discussion_r103848076

Received on Thursday, 2 March 2017 04:16:18 UTC