CVS html5/postmsg

Update of /sources/public/html5/postmsg
In directory roscoe:/tmp/cvs-serv31111

Modified Files:
	Overview.html 
Log Message:
The bulk of this is editorial: refactoring how scripts are defined so that all the common stuff is in a shared 'settings object' rather than being duplicated per script. But this also cleans up how postMessage() interacts with the event loop and a few other things I've since forgotten. (whatwg r8247)

--- /sources/public/html5/postmsg/Overview.html	2013/10/18 06:28:11	1.153
+++ /sources/public/html5/postmsg/Overview.html	2013/10/30 23:18:13	1.154
@@ -216,7 +216,7 @@
 
    <h1>HTML5 Web Messaging</h1>
    
-   <h2 class="no-num no-toc" id="editor-s-draft-18-october-2013">Editor's Draft 18 October 2013</h2>
+   <h2 class="no-num no-toc" id="editor-s-draft-30-october-2013">Editor's Draft 30 October 2013</h2>
    <dl><dt>Latest Published Version:</dt>
     <dd><a href="http://www.w3.org/TR/webmessaging/">http://www.w3.org/TR/webmessaging/</a></dd>
     <dt>Latest Editor's Draft:</dt>
@@ -348,7 +348,7 @@
   </dl><p>The W3C <a href="http://www.w3.org/2008/webapps/">Web Applications
   Working Group</a> is the W3C working group responsible for this
   specification's progress along the W3C Recommendation track.
-  This specification is the 18 October 2013 Editor's Draft.
+  This specification is the 30 October 2013 Editor's Draft.
   </p>
 
   
@@ -790,7 +790,7 @@
 
     <ol><li>
 
-      <p>Let <var title="">new owner</var> be the <code>Window</code> object on which the method was
+      <p>Let <var title="">new owner</var> be the <span>script settings object</span> of the <code>Window</code> object on which the method was
       invoked.</p>
 
      </li>
@@ -823,9 +823,11 @@
 
    <li>
 
+
     <p>If the <var title="">targetOrigin</var> argument is a single literal U+002F SOLIDUS character
     (/), and the <code>Document</code> of the <code>Window</code> object on which the method was
-    invoked does not have the <span>same origin</span> as the <span>entry script</span>'s <span title="script's document">document</span>, then abort these steps silently.</p>
+    invoked does not have the <span>same origin</span> as the <span>responsible document</span> specified by the <span>entry script</span>'s <span>settings
+    object</span>, then abort these steps silently.</p>
 
     <p>Otherwise, if the <var title="">targetOrigin</var> argument is an <span>absolute URL</span>,
     and the <code>Document</code> of the <code>Window</code> object on which the method was invoked
@@ -839,12 +841,16 @@
 
    <li>
 
+
     <p>Create a <span title="concept-events-trusted">trusted</span> event that uses the
     <code><a href="#messageevent">MessageEvent</a></code> interface, with the event type <code title="event-message"><a href="#event-message">message</a></code>, which does not bubble, is not cancelable, and has no
     default action. The <code title="dom-MessageEvent-data"><a href="#dom-messageevent-data">data</a></code> attribute must be
     initialized to the value of <var title="">message clone</var>, the <code title="dom-MessageEvent-origin"><a href="#dom-messageevent-origin">origin</a></code> attribute must be initialized to the <span title="Unicode serialization of an origin">Unicode serialization</span> of the
     <span>origin</span> of the <span>incumbent script</span>, the <code title="dom-MessageEvent-source"><a href="#dom-messageevent-source">source</a></code> attribute must be initialized to the
-    <span>script's global object</span>'s <code>WindowProxy</code> object, and the <code title="dom-MessageEvent-ports"><a href="#dom-messageevent-ports">ports</a></code> attribute must be initialized to the <var title="">new ports</var> array.
+    <code>WindowProxy</code> object corresponding to the
+    <span>global object</span> (a <code>Window</code> object) specified by the
+    <span>incumbent script</span>'s <span>settings object</span>,
+    and the <code title="dom-MessageEvent-ports"><a href="#dom-messageevent-ports">ports</a></code> attribute must be initialized to the <var title="">new ports</var> array.
     
     <a href="#refsHTML">[HTML]</a>
     
@@ -1082,11 +1088,14 @@
   <p>When the <dfn id="dom-messagechannel" title="dom-MessageChannel"><code>MessageChannel()</code></dfn> constructor is
   called, it must run the following algorithm:</p>
 
-  <ol><li><p><a href="#create-a-new-messageport-object">Create a new <code>MessagePort</code> object</a> owned by the <span>script's
-   global object</span>, and let <var title="">port1</var> be that object.</li>
+  <ol><li><p><a href="#create-a-new-messageport-object">Create a new <code>MessagePort</code> object</a> whose <a href="#concept-port-owner" title="concept-port-owner">owner</a>
+   is the <span>settings object</span>
+   of the <span>incumbent script</span>, and let <var title="">port1</var> be that object.</li>
+
 
-   <li><p><a href="#create-a-new-messageport-object">Create a new <code>MessagePort</code> object</a> owned by the <span>script's
-   global object</span>, and let <var title="">port2</var> be that object.</li>
+   <li><p><a href="#create-a-new-messageport-object">Create a new <code>MessagePort</code> object</a> whose <a href="#concept-port-owner" title="concept-port-owner">owner</a>
+   is the <span>settings object</span>
+   of the <span>incumbent script</span>, and let <var title="">port2</var> be that object.</li>
 
    <li><p><a href="#entangle">Entangle</a> the <var title="">port1</var> and <var title="">port2</var>
    objects.</li>
@@ -1158,21 +1167,30 @@
   message queue</dfn>, initially empty. A <a href="#port-message-queue">port message queue</a> can be enabled or
   disabled, and is initially disabled. Once enabled, a port can never be disabled again (though
   messages in the queue can get moved to another queue or removed altogether, which has much the
-  same effect). A <code><a href="#messageport">MessagePort</a></code> also has a <dfn id="has-been-shipped">has been shipped</dfn> flag. It must
-  initially be false.</p>
+  same effect). A <code><a href="#messageport">MessagePort</a></code> also has a <dfn id="has-been-shipped">has been shipped</dfn> flag, which must
+  initially be false, and an <dfn id="concept-port-owner" title="concept-port-owner">owner</dfn>, which is a <span>settings
+  object</span> set when the object is created, as described below.</p>
+
 
   <p>When a port's <a href="#port-message-queue">port message queue</a> is enabled, the <span>event loop</span> must use
-  it as one of its <span title="task source">task sources</span>.</p>
+  it as one of its <span title="task source">task sources</span>. All <span title="concept-task">tasks</span> <span title="queue a task">queued</span> on the <a href="#port-message-queue">port
+  message queue</a> must be associated with the <span>responsible document</span> specified by
+  the port's <a href="#concept-port-owner" title="concept-port-owner">owner</a>.</p>
+
 
-  <p class="note">If the <code>Document</code> of the port's event listeners' <span title="script's
-  global object">global object</span> is not <span>fully active</span>, then the messages are
+  <p class="note">If the port's <a href="#concept-port-owner" title="concept-port-owner">owner</a> specifies a <span>responsible document</span> that is <span>fully active</span>,
+  but the event listeners all have scripts whose <span title="settings object">settings objects</span>
+  specify <span title="responsible document">responsible documents</span> that are <em>not</em> <span>fully active</span>, then the messages will be
   lost.</p> 
 
+
   <p>Each <span>event loop</span> has a <span>task source</span> called the <dfn id="unshipped-port-message-queue">unshipped port
   message queue</dfn>. This is a virtual <span>task source</span>: it must act as if it contained
   the <span title="concept-task">tasks</span> of each <a href="#port-message-queue">port message queue</a> of each
-  <code><a href="#messageport">MessagePort</a></code> whose <a href="#has-been-shipped">has been shipped</a> flag is false and whose <a href="#port-message-queue">port
-  message queue</a> is enabled, in the order in which they were added to their respective
+  <code><a href="#messageport">MessagePort</a></code> whose <a href="#has-been-shipped">has been shipped</a> flag is false, whose <a href="#port-message-queue">port
+  message queue</a> is enabled, and whose <a href="#concept-port-owner" title="concept-port-owner">owner</a>
+  specifies that <span>event loop</span> as the <span>responsible event loop</span>,
+  in the order in which they were added to their respective
   <span>task source</span>. When a <span title="concept-task">task</span> would be removed from the
   <a href="#unshipped-port-message-queue">unshipped port message queue</a>, it must instead be removed from its <a href="#port-message-queue">port message
   queue</a>.</p>
@@ -1187,9 +1205,10 @@
   is true, its <a href="#port-message-queue">port message queue</a> acts as a first-class <span>task source</span>,
   unaffected to any <a href="#unshipped-port-message-queue">unshipped port message queue</a>.</p>
 
-  <p>When the user agent is to <dfn id="create-a-new-messageport-object">create a new <code>MessagePort</code> object</dfn> owned by a
-  <span>script's global object</span> object <var title="">owner</var>, it must instantiate a new
-  <code><a href="#messageport">MessagePort</a></code> object, and let its owner be <var title="">owner</var>.</p>
+
+  <p>When the user agent is to <dfn id="create-a-new-messageport-object">create a new <code>MessagePort</code> object</dfn> with a particular
+  <span>settings object</span> as its <var title="">owner</var>, it must instantiate a new
+  <code><a href="#messageport">MessagePort</a></code> object, and let its <a href="#concept-port-owner" title="concept-port-owner">owner</a> be <var title="">owner</var>.</p>
 
   <p>When the user agent is to <dfn id="entangle">entangle</dfn> two <code><a href="#messageport">MessagePort</a></code> objects, it must run
   the following steps:</p>
@@ -1227,7 +1246,7 @@
   <ol><li><p>Set <var title="">original port</var>'s <a href="#has-been-shipped">has been shipped</a> flag to
    true.</li>
 
-   <li><p><a href="#create-a-new-messageport-object">Create a new <code>MessagePort</code> object</a> owned by <var title="">owner</var>, and let <var title="">new port</var> be that object.</li>
+   <li><p><a href="#create-a-new-messageport-object">Create a new <code>MessagePort</code> object</a> whose <a href="#concept-port-owner" title="concept-port-owner">owner</a> is <var title="">owner</var>, and let <var title="">new port</var> be that object.</li>
 
    <li><p>Set <var title="">new port</var>'s <a href="#has-been-shipped">has been shipped</a> flag to true.</li>
 
@@ -1329,7 +1348,8 @@
 
     <ol><li>
 
-      <p>Let <var title="">new owner</var> be the owner of <var title="">target port</var>, if there
+
+      <p>Let <var title="">new owner</var> be the <a href="#concept-port-owner" title="concept-port-owner">owner</a> of <var title="">target port</var>, if there
       is a <var title="">target port</var>, or else some arbitrary owner. (This <var title="">new
       owner</var> is used when transferring objects below. If there is no <var title="">target
       port</var>, the <code>Transferable</code> objects given in the second argument, if any, are
@@ -1506,9 +1526,10 @@
 
   <div class="impl">
 
+
   <p>When a <code><a href="#messageport">MessagePort</a></code> object <var title="">o</var> is entangled, user agents must
   either act as if <var title="">o</var>'s entangled <code><a href="#messageport">MessagePort</a></code> object has a strong
-  reference to <var title="">o</var>, or as if <var title="">o</var>'s owner has a strong reference
+  reference to <var title="">o</var>, or as if the <span>global object</span> specified by <var title="">o</var>'s <a href="#concept-port-owner" title="concept-port-owner">owner</a> has a strong reference
   to <var title="">o</var>.</p>
 
   <div class="note">

Received on Wednesday, 30 October 2013 23:18:19 UTC