[html5] r8590 - [giow] (0) Make BroadcastChannel support structured clones Fixing https://www.w3 [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Apr 29 17:13:59 PDT 2014


Author: ianh
Date: 2014-04-29 17:13:56 -0700 (Tue, 29 Apr 2014)
New Revision: 8590

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Make BroadcastChannel support structured clones
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=25415
Affected topics: DOM APIs

Modified: complete.html
===================================================================
--- complete.html	2014-04-30 00:04:25 UTC (rev 8589)
+++ complete.html	2014-04-30 00:13:56 UTC (rev 8590)
@@ -83442,7 +83442,7 @@
   <pre class=idl>[<a href=#dom-broadcastchannel title=dom-BroadcastChannel>Constructor</a>(DOMString channel)]
 interface <dfn id=broadcastchannel>BroadcastChannel</dfn> : <a href=#eventtarget>EventTarget</a> {
   readonly attribute DOMString <a href=#dom-broadcastchannel-name title=dom-BroadcastChannel-name>name</a>;
-  void <a href=#dom-broadcastchannel-postmessage title=dom-BroadcastChannel-postMessage>postMessage</a>(DOMString message);
+  void <a href=#dom-broadcastchannel-postmessage title=dom-BroadcastChannel-postMessage>postMessage</a>(any message);
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-broadcastchannel-onmessage title=handler-BroadcastChannel-onmessage>onmessage</a>;
 };</pre>
 
@@ -83466,7 +83466,7 @@
 
    <dd>
 
-    <p>Sends the given message to other <code><a href=#broadcastchannel>BroadcastChannel</a></code> objects set up for this channel.</p>
+    <p>Sends the given message to other <code><a href=#broadcastchannel>BroadcastChannel</a></code> objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.</p>
 
    </dd>
 
@@ -83493,6 +83493,9 @@
    <li><p>Let <var title="">source channel</var> be <var title="">source</var>'s
    <a href=#channel-name>channel name</a>.</p>
 
+   <li><p>Let <var title="">cloned message</var> be a <a href=#structured-clone>structured clone</a> of the <var title="">message</var> argument. If this throws an exception, then rethrow that exception and
+   abort these steps.</li>
+
    <li>
 
     <p>Let <var title="">destinations</var> be a list of <code><a href=#broadcastchannel>BroadcastChannel</a></code> objects that
@@ -83548,7 +83551,9 @@
     <ol><!--CLEANUP--><li><p>Create an 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 the <var title="">message</var> argument, and the <code title=dom-MessageEvent-origin><a href=#dom-messageevent-origin>origin</a></code> attribute must be initialized to the <a href=#unicode-serialization-of-an-origin title="Unicode serialization of an origin">Unicode serialization</a> of the
+     initialized to a <a href=#structured-clone>structured clone</a> of <var title="">cloned message</var><!-- it's
+     a clone of /cloned message/, not /message/, so that there's no risk of running scripts again
+     -->, and the <code title=dom-MessageEvent-origin><a href=#dom-messageevent-origin>origin</a></code> attribute must be initialized to the <a href=#unicode-serialization-of-an-origin title="Unicode serialization of an origin">Unicode serialization</a> of the
      <a href=#origin>origin</a> specified by <var title="">source settings</var>. This event is not <a href=#concept-events-trusted title=concept-events-trusted>trusted</a>.</li>
 
      <li><p><a href=#concept-event-dispatch title=concept-event-dispatch>Dispatch</a> the event at the

Modified: index
===================================================================
--- index	2014-04-30 00:04:25 UTC (rev 8589)
+++ index	2014-04-30 00:13:56 UTC (rev 8590)
@@ -83442,7 +83442,7 @@
   <pre class=idl>[<a href=#dom-broadcastchannel title=dom-BroadcastChannel>Constructor</a>(DOMString channel)]
 interface <dfn id=broadcastchannel>BroadcastChannel</dfn> : <a href=#eventtarget>EventTarget</a> {
   readonly attribute DOMString <a href=#dom-broadcastchannel-name title=dom-BroadcastChannel-name>name</a>;
-  void <a href=#dom-broadcastchannel-postmessage title=dom-BroadcastChannel-postMessage>postMessage</a>(DOMString message);
+  void <a href=#dom-broadcastchannel-postmessage title=dom-BroadcastChannel-postMessage>postMessage</a>(any message);
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-broadcastchannel-onmessage title=handler-BroadcastChannel-onmessage>onmessage</a>;
 };</pre>
 
@@ -83466,7 +83466,7 @@
 
    <dd>
 
-    <p>Sends the given message to other <code><a href=#broadcastchannel>BroadcastChannel</a></code> objects set up for this channel.</p>
+    <p>Sends the given message to other <code><a href=#broadcastchannel>BroadcastChannel</a></code> objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.</p>
 
    </dd>
 
@@ -83493,6 +83493,9 @@
    <li><p>Let <var title="">source channel</var> be <var title="">source</var>'s
    <a href=#channel-name>channel name</a>.</p>
 
+   <li><p>Let <var title="">cloned message</var> be a <a href=#structured-clone>structured clone</a> of the <var title="">message</var> argument. If this throws an exception, then rethrow that exception and
+   abort these steps.</li>
+
    <li>
 
     <p>Let <var title="">destinations</var> be a list of <code><a href=#broadcastchannel>BroadcastChannel</a></code> objects that
@@ -83548,7 +83551,9 @@
     <ol><!--CLEANUP--><li><p>Create an 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 the <var title="">message</var> argument, and the <code title=dom-MessageEvent-origin><a href=#dom-messageevent-origin>origin</a></code> attribute must be initialized to the <a href=#unicode-serialization-of-an-origin title="Unicode serialization of an origin">Unicode serialization</a> of the
+     initialized to a <a href=#structured-clone>structured clone</a> of <var title="">cloned message</var><!-- it's
+     a clone of /cloned message/, not /message/, so that there's no risk of running scripts again
+     -->, and the <code title=dom-MessageEvent-origin><a href=#dom-messageevent-origin>origin</a></code> attribute must be initialized to the <a href=#unicode-serialization-of-an-origin title="Unicode serialization of an origin">Unicode serialization</a> of the
      <a href=#origin>origin</a> specified by <var title="">source settings</var>. This event is not <a href=#concept-events-trusted title=concept-events-trusted>trusted</a>.</li>
 
      <li><p><a href=#concept-event-dispatch title=concept-event-dispatch>Dispatch</a> the event at the

Modified: source
===================================================================
--- source	2014-04-30 00:04:25 UTC (rev 8589)
+++ source	2014-04-30 00:13:56 UTC (rev 8590)
@@ -93710,7 +93710,7 @@
   <pre class="idl">[<span data-x="dom-BroadcastChannel">Constructor</span>(DOMString channel)]
 interface <dfn>BroadcastChannel</dfn> : <span>EventTarget</span> {
   readonly attribute DOMString <span data-x="dom-BroadcastChannel-name">name</span>;
-  void <span data-x="dom-BroadcastChannel-postMessage">postMessage</span>(DOMString message);
+  void <span data-x="dom-BroadcastChannel-postMessage">postMessage</span>(any message);
            attribute <span>EventHandler</span> <span data-x="handler-BroadcastChannel-onmessage">onmessage</span>;
 };</pre>
 
@@ -93736,7 +93736,7 @@
 
    <dd>
 
-    <p>Sends the given message to other <code>BroadcastChannel</code> objects set up for this channel.</p>
+    <p>Sends the given message to other <code>BroadcastChannel</code> objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.</p>
 
    </dd>
 
@@ -93767,6 +93767,10 @@
    <li><p>Let <var data-x="">source channel</var> be <var data-x="">source</var>'s
    <span>channel name</span>.</p>
 
+   <li><p>Let <var data-x="">cloned message</var> be a <span>structured clone</span> of the <var
+   data-x="">message</var> argument. If this throws an exception, then rethrow that exception and
+   abort these steps.</p></li>
+
    <li>
 
     <p>Let <var data-x="">destinations</var> be a list of <code>BroadcastChannel</code> objects that
@@ -93834,7 +93838,9 @@
      <li><p>Create an event that uses the <code>MessageEvent</code> interface, with the event type
      <code data-x="event-message">message</code>, which does not bubble, is not cancelable, and has
      no default action. The <code data-x="dom-MessageEvent-data">data</code> attribute must be
-     initialized to the value of the <var data-x="">message</var> argument, and the <code
+     initialized to a <span>structured clone</span> of <var data-x="">cloned message</var><!-- it's
+     a clone of /cloned message/, not /message/, so that there's no risk of running scripts again
+     -->, and the <code
      data-x="dom-MessageEvent-origin">origin</code> attribute must be initialized to the <span
      data-x="Unicode serialization of an origin">Unicode serialization</span> of the
      <span>origin</span> specified by <var data-x="">source settings</var>. This event is not <span




More information about the Commit-Watchers mailing list