Skip to content
Permalink
Browse files

[giow] (0) Make BroadcastChannel support structured clones

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=25415
Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@8590 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Apr 30, 2014
1 parent 87994a6 commit d017866098570b96d3f92ee88d72a56efbe65f4c
Showing with 25 additions and 9 deletions.
  1. +8 −3 complete.html
  2. +8 −3 index
  3. +9 −3 source
<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>


<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>

<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
<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
11 index
<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>


<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>

<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
<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
12 source
<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>


<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>

<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
<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

0 comments on commit d017866

Please sign in to comment.
You can’t perform that action at this time.