hixie: intro for channel messaging (whatwg r4475)

hixie: intro for channel messaging (whatwg r4475)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3574&r2=1.3575&f=h
http://html5.org/tools/web-apps-tracker?from=4474&to=4475

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3574
retrieving revision 1.3575
diff -u -d -r1.3574 -r1.3575
--- Overview.html 5 Jan 2010 06:44:28 -0000 1.3574
+++ Overview.html 5 Jan 2010 07:29:10 -0000 1.3575
@@ -1022,10 +1022,11 @@
      <li><a href="#posting-messages-with-message-ports"><span class="secno">8.2.4 </span>Posting messages with message ports</a></ol></li>
    <li><a href="#channel-messaging"><span class="secno">8.3 </span>Channel messaging</a>
     <ol>
-     <li><a href="#message-channels"><span class="secno">8.3.1 </span>Message channels</a></li>
-     <li><a href="#message-ports"><span class="secno">8.3.2 </span>Message ports</a>
+     <li><a href="#introduction-6"><span class="secno">8.3.1 </span>Introduction</a></li>
+     <li><a href="#message-channels"><span class="secno">8.3.2 </span>Message channels</a></li>
+     <li><a href="#message-ports"><span class="secno">8.3.3 </span>Message ports</a>
       <ol>
-       <li><a href="#ports-and-garbage-collection"><span class="secno">8.3.2.1 </span>Ports and garbage collection</a></ol></ol></ol></li>
+       <li><a href="#ports-and-garbage-collection"><span class="secno">8.3.3.1 </span>Ports and garbage collection</a></ol></ol></ol></li>
  <li><a href="#syntax"><span class="secno">9 </span>The HTML syntax</a>
   <ol>
    <li><a href="#writing"><span class="secno">9.1 </span>Writing HTML documents</a>
@@ -1181,10 +1182,10 @@
    <li><a href="#parsing-xhtml-fragments"><span class="secno">10.4 </span>Parsing XHTML fragments</a></ol></li>
  <li><a href="#rendering"><span class="secno">11 </span>Rendering</a>
   <ol>
-   <li><a href="#introduction-6"><span class="secno">11.1 </span>Introduction</a></li>
+   <li><a href="#introduction-7"><span class="secno">11.1 </span>Introduction</a></li>
    <li><a href="#the-css-user-agent-style-sheet-and-presentational-hints"><span class="secno">11.2 </span>The CSS user agent style sheet and presentational hints</a>
     <ol>
-     <li><a href="#introduction-7"><span class="secno">11.2.1 </span>Introduction</a></li>
+     <li><a href="#introduction-8"><span class="secno">11.2.1 </span>Introduction</a></li>
      <li><a href="#display-types"><span class="secno">11.2.2 </span>Display types</a></li>
      <li><a href="#margins-and-padding"><span class="secno">11.2.3 </span>Margins and padding</a></li>
      <li><a href="#alignment"><span class="secno">11.2.4 </span>Alignment</a></li>
@@ -1202,7 +1203,7 @@
      <li><a href="#toolbars-0"><span class="secno">11.3.5 </span>Toolbars</a></ol></li>
    <li><a href="#bindings"><span class="secno">11.4 </span>Bindings</a>
     <ol>
-     <li><a href="#introduction-8"><span class="secno">11.4.1 </span>Introduction</a></li>
+     <li><a href="#introduction-9"><span class="secno">11.4.1 </span>Introduction</a></li>
      <li><a href="#the-button-element-0"><span class="secno">11.4.2 </span>The <code>button</code> element</a></li>
      <li><a href="#the-details-element-0"><span class="secno">11.4.3 </span>The <code>details</code> element</a></li>
      <li><a href="#the-input-element-as-a-text-entry-widget"><span class="secno">11.4.4 </span>The <code>input</code> element as a text entry widget</a></li>
@@ -53019,7 +53020,19 @@
   sections be kept separate so that implementors can avoid getting
   confused with the 'port' step. -->
 
-  </div><h3 id="channel-messaging"><span class="secno">8.3 </span><dfn>Channel messaging</dfn></h3><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><h4 id="message-channels"><span class="secno">8.3.1 </span>Message channels</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><pre class="idl">[<a href="#dom-messagechannel" title="dom-MessageChannel">Constructor</a>]
+  </div><h3 id="channel-messaging"><span class="secno">8.3 </span><dfn>Channel messaging</dfn></h3><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><h4 id="introduction-6"><span class="secno">8.3.1 </span>Introduction</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><p><i>This section is non-normative.</i><p>To enable independent pieces of code (e.g. running in different
+  <a href="#browsing-context" title="browsing context">browsing contexts</a>) to
+  communicate directly, authors can use <a href="#channel-messaging">channel
+  messaging</a>.<p>Communication channels in this mechanisms are implemented as
+  two-ways pipes, with a port at each end. Messages sent in one port
+  are delivered at the other port, and vice-versa. Messages are
+  asynchronous, and delivered as DOM events.<p>To create a connection (two "entangled" ports), the <code title="">MessageChannel()</code> constructor is called:<pre>var channel = new MessageChannel();</pre><p>One of the ports is kept as the local port, and the other port is
+  sent to the remote code, e.g. using <code title="dom-window-postMessage-3"><a href="#dom-window-postmessage-3">postMessage()</a></code>:<pre>otherWindow.postMessage('hello', [channel.port2], 'http://example.com');</pre><p>To send messages, the <code title="dom-MessagpePort-postMessage">postMessage()</code> method on
+  the port is used:<pre>channel.port1.postMessage('hello');</pre><p>To receive messages, one listens to <code title="event-message"><a href="#event-message">message</a></code> events:<pre>channel.port1.onmessage = handleMessage;
+function handleMessage(event) {
+  // message is in event.data
+  // ...
+}</pre><h4 id="message-channels"><span class="secno">8.3.2 </span>Message channels</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><pre class="idl">[<a href="#dom-messagechannel" title="dom-MessageChannel">Constructor</a>]
 interface <dfn id="messagechannel">MessageChannel</dfn> {
   readonly attribute <a href="#messageport">MessagePort</a> <a href="#dom-channel-port1" title="dom-channel-port1">port1</a>;
   readonly attribute <a href="#messageport">MessagePort</a> <a href="#dom-channel-port2" title="dom-channel-port2">port2</a>;
@@ -53080,7 +53093,7 @@
   must return the values they were assigned when the
   <code><a href="#messagechannel">MessageChannel</a></code> object was created.</p>
 
-  </div><h4 id="message-ports"><span class="secno">8.3.2 </span>Message ports</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><p>Each channel has two message ports. Data sent through one port is
+  </div><h4 id="message-ports"><span class="secno">8.3.3 </span>Message ports</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><p>Each channel has two message ports. Data sent through one port is
   received by the other port, and vice versa.<pre class="idl">typedef sequence&lt;MessagePort&gt; <dfn id="messageportarray">MessagePortArray</dfn>;
 
 interface <dfn id="messageport">MessagePort</dfn> {
@@ -53358,7 +53371,7 @@
   as if the <code title="dom-MessagePort-start"><a href="#dom-messageport-start">start()</a></code> method
   had been called.</p>
 
-  </div><h5 id="ports-and-garbage-collection"><span class="secno">8.3.2.1 </span>Ports and garbage collection</h5><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><div class="impl">
+  </div><h5 id="ports-and-garbage-collection"><span class="secno">8.3.3.1 </span>Ports and garbage collection</h5><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><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
@@ -64173,7 +64186,7 @@
   lead to this experience.</i></p>
 
 
-  <h3 id="introduction-6"><span class="secno">11.1 </span>Introduction</h3><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p>
+  <h3 id="introduction-7"><span class="secno">11.1 </span>Introduction</h3><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p>
 
   <p>In general, user agents are expected to support CSS, and many of
   the suggestions in this section are expressed in CSS terms. User
@@ -64208,7 +64221,7 @@
 
   <h3 id="the-css-user-agent-style-sheet-and-presentational-hints"><span class="secno">11.2 </span>The CSS user agent style sheet and presentational hints</h3><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p>
 
-  <h4 id="introduction-7"><span class="secno">11.2.1 </span>Introduction</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p>
+  <h4 id="introduction-8"><span class="secno">11.2.1 </span>Introduction</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p>
 
   <p>The CSS rules given in these subsections are, except where
   otherwise specified, expected to be used as part of the user-agent
@@ -65377,7 +65390,7 @@
 
   <h3 id="bindings"><span class="secno">11.4 </span>Bindings</h3><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p>
 
-  <h4 id="introduction-8"><span class="secno">11.4.1 </span>Introduction</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p>
+  <h4 id="introduction-9"><span class="secno">11.4.1 </span>Introduction</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p>
 
   <p>A number of elements have their rendering defined in terms of the
   'binding' property. <a href="#refsBECSS">[BECSS]</a></p>

Received on Tuesday, 5 January 2010 07:29:52 UTC