[html5] r2532 - [gw] (2) Drop MessagePort.onclose. Make MessagePort's message queue actually plu [...]
whatwg at whatwg.org
whatwg at whatwg.org
Mon Dec 15 17:33:53 PST 2008
Author: ianh
Date: 2008-12-15 17:33:52 -0800 (Mon, 15 Dec 2008)
New Revision: 2532
Modified:
index
source
Log:
[gw] (2) Drop MessagePort.onclose. Make MessagePort's message queue actually plug straight into the event loop so you can't lost events when sending ports across to other event loops.
Modified: index
===================================================================
--- index 2008-12-16 01:01:37 UTC (rev 2531)
+++ index 2008-12-16 01:33:52 UTC (rev 2532)
@@ -42778,13 +42778,7 @@
null, and the <code title=dom-MessageEvent-messagePort><a href=#dom-messageevent-messageport>messagePort</a></code>
attribute must be null.</p>
- <hr><p><a href=#concept-task title=concept-task>Tasks</a> in <a href=#server-sent-events>server-sent
- events</a> and <a href=#network>Web Sockets</a> use their own <a href=#task-source title="task source">task sources</a>, but the <a href=#task-source>task
- source</a> for the <a href=#concept-task title=concept-task>tasks</a> in
- <a href=#crossDocumentMessages>cross-document messaging</a> and <a href=#channel-messaging>channel
- messaging</a> is the <dfn id=posted-message-task-source>posted message task source</dfn>.</p>
-
<h3 id=server-sent-events><span class=secno>7.2 </span><dfn>Server-sent events</dfn></h3>
<!-- eventsource -->
@@ -44131,7 +44125,10 @@
domain, in a way designed to not enable cross-site scripting
attacks.</p>
+ <p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> in <a href=#crossDocumentMessages>cross-document
+ messaging</a> is the <dfn id=posted-message-task-source>posted message task source</dfn>.</p>
+
<h4 id=introduction-5><span class=secno>7.4.1 </span>Introduction</h4>
<p><em>This section is non-normative.</em></p>
@@ -44445,7 +44442,6 @@
// event handler attributes
attribute <span>EventListener</span> <a href=#handler-messageport-onmessage title=handler-MessagePort-onmessage>onmessage</a>;
- attribute <span>EventListener</span> <a href=#handler-messageport-onclose title=handler-MessagePort-onclose>onclose</a>;
};</pre>
<p>Objects implementing the <code><a href=#messageport>MessagePort</a></code> interface must
@@ -44453,9 +44449,9 @@
<p>Each <code><a href=#messageport>MessagePort</a></code> object can be entangled with
another (a symmetric relationship). Each <code><a href=#messageport>MessagePort</a></code>
- object also has a <dfn id=port-message-queue>port message queue</dfn>, initial empty. A
- <a href=#port-message-queue>port message queue</a> can be open or closed, and is
- initially closed.</p>
+ object also has a <a href=#task-source>task source</a> called the <dfn id=port-message-queue>port
+ message queue</dfn>, initial empty. A <a href=#port-message-queue>port message
+ queue</a> can be open or closed, and is initially closed.</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 <a href="#script's-global-object">script's
@@ -44529,9 +44525,8 @@
<li><p>If the <var title="">source port</var> is not entangled with
another port, then return and abort these steps.</li>
<!-- we don't raise an exception because this can happen moment's
- notice. listen to onclose if you want to know when things start
- going wonky. (We don't return false because if the port is _about_
- to be closed, the message might not be listened for anyway.) -->
+ notice. we don't return false because if the port is _about_
+ to be closed, the message might not be listened for anyway. -->
<li><p>Let <var title="">target port</var> be the port with which
<var title="">source port</var> is entangled.</li>
@@ -44593,10 +44588,9 @@
another port, then return <var title="">port1</var> and abort these
steps.</p></li>
<!- - we don't raise an exception because this can happen moment's
- notice. listen to onclose if you want to know when things start
- going wonky. (We don't return null because then we'd end up with
+ notice. we don't return null because then we'd end up with
null derefs. better to just let the likely next postMessage call
- fall on the floor) - ->
+ fall on the floor. - ->
<li><p>Let <var title="">target port</var> be the port with which
<var title="">source port</var> is entangled.</p></li>
@@ -44633,37 +44627,19 @@
method must open its port's <a href=#port-message-queue>port message queue</a>, if it
is not already open.</p>
- <p>When a port's <a href=#port-message-queue>port message queue</a> is open and
- contains an event, the user agent must <a href=#queue-a-task>queue a task</a> in
- the <a href=#event-loop>event loop</a> to dispatch the first event in the queue
- on the <code><a href=#messageport>MessagePort</a></code> object, and remove the event from
- the queue. The <a href=#task-source>task source</a> for this <a href=#concept-task title=concept-task>task</a> is the <a href=#posted-message-task-source>posted message task
- source</a>.</p>
+ <p>When a port's <a href=#port-message-queue>port message queue</a> is open, the
+ <a href=#event-loop>event loop</a> must use it as one of its <a href=#task-source title="task
+ source">task sources</a>.</p>
<p class=note>If the <a href=#script-group>script group</a> of the port's event
handlers is <i>frozen</i>, then the messages are lost.</p>
<hr><p>The <dfn id=dom-messageport-close title=dom-MessagePort-close><code>close()</code></dfn>
method, when called on a port <var title="">local port</var> that is
- entangled with another port, must cause the user agents to run the
- following steps:</p>
+ entangled with another port, must cause the user agents to
+ unentangle the two ports. If the method is called on a port that is
+ not entangled, then the method must do nothing.</p>
- <ol><li><p>Unentangle the two ports.</li>
-
- <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> called <code title=event-close>close</code> at the
- port on which the method was called.</li>
-
- <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple
- event</a> called <code title=event-close>close</code> at the
- other port.</li>
-
- </ol><p>The <a href=#task-source>task source</a> for the two <a href=#concept-task title=concept-task>tasks</a> above is the <a href=#posted-message-task-source>posted message
- task source</a>.
-
- <p>If the method is called on a port that is not entangled, then the
- method must do nothing.</p>
-
<hr><p>The following are the <a href=#event-handler-dom-attributes>event handler DOM attributes</a>
that must be supported by objects implementing the
<code><a href=#messageport>MessagePort</a></code> interface:</p>
@@ -44682,11 +44658,6 @@
</dd>
- <dt><dfn id=handler-messageport-onclose title=handler-MessagePort-onclose><code>onclose</code></dfn></dt>
-
- <dd><p>Must be invoked whenever a <code title=event-close>close</code> event is targeted at or bubbles
- through the <code><a href=#messageport>MessagePort</a></code> object.</dd>
-
</dl><h5 id=ports-and-garbage-collection><span class=secno>7.5.3.1 </span>Ports and garbage collection</h5>
<p>User agents must act as if <code><a href=#messageport>MessagePort</a></code> objects have
Modified: source
===================================================================
--- source 2008-12-16 01:01:37 UTC (rev 2531)
+++ source 2008-12-16 01:33:52 UTC (rev 2532)
@@ -48860,16 +48860,7 @@
null, and the <code title="dom-MessageEvent-messagePort">messagePort</code>
attribute must be null.</p>
- <hr>
- <p><span title="concept-task">Tasks</span> in <span>server-sent
- events</span> and <span>Web Sockets</span> use their own <span
- title="task source">task sources</span>, but the <span>task
- source</span> for the <span title="concept-task">tasks</span> in
- <span>cross-document messaging</span> and <span>channel
- messaging</span> is the <dfn>posted message task source</dfn>.</p>
-
-
<h3 id="server-sent-events"><dfn>Server-sent events</dfn></h3>
<!-- eventsource -->
@@ -50390,7 +50381,11 @@
domain, in a way designed to not enable cross-site scripting
attacks.</p>
+ <p>The <span>task source</span> for the <span
+ title="concept-task">tasks</span> in <span>cross-document
+ messaging</span> is the <dfn>posted message task source</dfn>.</p>
+
<h4>Introduction</h4>
<p><em>This section is non-normative.</em></p>
@@ -50754,7 +50749,6 @@
// event handler attributes
attribute <span>EventListener</span> <span title="handler-MessagePort-onmessage">onmessage</span>;
- attribute <span>EventListener</span> <span title="handler-MessagePort-onclose">onclose</span>;
};</pre>
<p>Objects implementing the <code>MessagePort</code> interface must
@@ -50762,9 +50756,9 @@
<p>Each <code>MessagePort</code> object can be entangled with
another (a symmetric relationship). Each <code>MessagePort</code>
- object also has a <dfn>port message queue</dfn>, initial empty. A
- <span>port message queue</span> can be open or closed, and is
- initially closed.</p>
+ object also has a <span>task source</span> called the <dfn>port
+ message queue</dfn>, initial empty. A <span>port message
+ queue</span> can be open or closed, and is initially closed.</p>
<p>When the user agent is to <dfn>create a new
<code>MessagePort</code> object</dfn> owned by a <span>script's
@@ -50860,9 +50854,8 @@
<li><p>If the <var title="">source port</var> is not entangled with
another port, then return and abort these steps.</p></li>
<!-- we don't raise an exception because this can happen moment's
- notice. listen to onclose if you want to know when things start
- going wonky. (We don't return false because if the port is _about_
- to be closed, the message might not be listened for anyway.) -->
+ notice. we don't return false because if the port is _about_
+ to be closed, the message might not be listened for anyway. -->
<li><p>Let <var title="">target port</var> be the port with which
<var title="">source port</var> is entangled.</p></li>
@@ -50937,10 +50930,9 @@
another port, then return <var title="">port1</var> and abort these
steps.</p></li>
<!- - we don't raise an exception because this can happen moment's
- notice. listen to onclose if you want to know when things start
- going wonky. (We don't return null because then we'd end up with
+ notice. we don't return null because then we'd end up with
null derefs. better to just let the likely next postMessage call
- fall on the floor) - ->
+ fall on the floor. - ->
<li><p>Let <var title="">target port</var> be the port with which
<var title="">source port</var> is entangled.</p></li>
@@ -50979,13 +50971,9 @@
method must open its port's <span>port message queue</span>, if it
is not already open.</p>
- <p>When a port's <span>port message queue</span> is open and
- contains an event, the user agent must <span>queue a task</span> in
- the <span>event loop</span> to dispatch the first event in the queue
- on the <code>MessagePort</code> object, and remove the event from
- the queue. The <span>task source</span> for this <span
- title="concept-task">task</span> is the <span>posted message task
- source</span>.</p>
+ <p>When a port's <span>port message queue</span> is open, the
+ <span>event loop</span> must use it as one of its <span title="task
+ source">task sources</span>.</p>
<p class="note">If the <span>script group</span> of the port's event
handlers is <i>frozen</i>, then the messages are lost.</p>
@@ -50994,30 +50982,10 @@
<p>The <dfn title="dom-MessagePort-close"><code>close()</code></dfn>
method, when called on a port <var title="">local port</var> that is
- entangled with another port, must cause the user agents to run the
- following steps:</p>
+ entangled with another port, must cause the user agents to
+ unentangle the two ports. If the method is called on a port that is
+ not entangled, then the method must do nothing.</p>
- <ol>
-
- <li><p>Unentangle the two ports.</p></li>
-
- <li><p><span>Queue a task</span> to <span>fire a simple
- event</span> called <code title="event-close">close</code> at the
- port on which the method was called.</p></li>
-
- <li><p><span>Queue a task</span> to <span>fire a simple
- event</span> called <code title="event-close">close</code> at the
- other port.</p></li>
-
- </ol>
-
- <p>The <span>task source</span> for the two <span
- title="concept-task">tasks</span> above is the <span>posted message
- task source</span>.
-
- <p>If the method is called on a port that is not entangled, then the
- method must do nothing.</p>
-
<hr>
<p>The following are the <span>event handler DOM attributes</span>
@@ -51042,12 +51010,6 @@
</dd>
- <dt><dfn title="handler-MessagePort-onclose"><code>onclose</code></dfn></dt>
-
- <dd><p>Must be invoked whenever a <code
- title="event-close">close</code> event is targeted at or bubbles
- through the <code>MessagePort</code> object.</p></dd>
-
</dl>
More information about the Commit-Watchers
mailing list