[html5] r6185 - [giow] (0) Make structured clone handle getters. Fixing http://www.w3.org/Bugs/P [...]
whatwg at whatwg.org
whatwg at whatwg.org
Fri Jun 3 13:20:19 PDT 2011
Author: ianh
Date: 2011-06-03 13:20:17 -0700 (Fri, 03 Jun 2011)
New Revision: 6185
Modified:
complete.html
index
source
Log:
[giow] (0) Make structured clone handle getters.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=12101
Modified: complete.html
===================================================================
--- complete.html 2011-06-03 19:40:10 UTC (rev 6184)
+++ complete.html 2011-06-03 20:20:17 UTC (rev 6185)
@@ -8462,14 +8462,19 @@
<li><p>Let <var title="">output</var> be the value resulting from
calling the <a href=#internal-structured-cloning-algorithm>internal structured cloning algorithm</a> with
- <var title="">input</var> and <var title="">memory</var>.</li>
+ <var title="">input</var> as the "<var title="">input</var>"
+ argument, <var title="">memory</var> as the "<var title="">memory</var>" argument, and zero as the "<var title="">depth</var>" argument.</li>
<li><p>Return <var title="">output</var>.</li>
</ol><p>The <dfn id=internal-structured-cloning-algorithm>internal structured cloning algorithm</dfn> is always
- called with two arguments, <var title="">input</var> and <var title="">memory</var>, and its behavior is as follows:</p>
+ called with three arguments, <var title="">input</var>, <var title="">memory</var>, and <var title="">depth</var>, and its
+ behavior is as follows:</p>
- <ol><li><p>If <var title="">input</var> is the source object of a pair
+ <ol><li><p>If <var title="">depth</var> is greater than 1, return null
+ and abort these steps.</li>
+
+ <li><p>If <var title="">input</var> is the source object of a pair
of objects in <var title="">memory</var>, then return the
destination object in that pair of objects and abort these
steps.</li>
@@ -8555,9 +8560,17 @@
object, then, for each enumerable property in <var title="">input</var>, add a new property to <var title="">output</var> having the same name, and having a value
created from invoking the <a href=#internal-structured-cloning-algorithm>internal structured cloning
algorithm</a> recursively with the value of the property as the
- "<var title="">input</var>" argument and <var title="">memory</var> as the "<var title="">memory</var>"
- argument. The order of the properties in the <var title="">input</var> and <var title="">output</var> objects must
- be the same.</p>
+ "<var title="">input</var>" argument, <var title="">memory</var>
+ as the "<var title="">memory</var>" argument, and <span title=""><var title="">depth</var>+<var title="">newDepth</var></span> as the "<var title="">depth</var>"
+ argument, where <var title="">newDepth</var> is zero except if
+ obtaining the value of the property involved executing script, in
+ which case it is one (1). The order of the properties in the <var title="">input</var> and <var title="">output</var> objects must
+ be the same, and any properties that involve running script must
+ be processed in that same order. If obtaining the value of the
+ property involved executing script, and that script threw an
+ uncaught exception, then abort the overall <a href=#structured-clone>structured
+ clone</a> algorithm, with that exception being passed through
+ to the caller.</p>
<p class=note>This does not walk the prototype chain.</p>
@@ -62730,7 +62743,7 @@
<p>When either of these methods is invoked, the user agent must run
the following steps:</p>
- <ol><li><p>Let <var title="">clone data</var> be a <a href=#structured-clone>structured
+ <ol><li><p>Let <var title="">cloned data</var> be a <a href=#structured-clone>structured
clone</a> of the specified <var title="">data</var>. If this
throws an exception, then rethrow that exception and abort these
steps.</li>
@@ -62827,8 +62840,10 @@
<li>
- <p>Set <code title=dom-history-state><a href=#dom-history-state>history.state</a></code> to
- another <a href=#structured-clone>structured clone</a> of the specified <var title="">data</var>.</p>
+ <p>Set <code title=dom-history-state><a href=#dom-history-state>history.state</a></code> to a
+ <a href=#structured-clone>structured clone</a> of <var title="">cloned
+ data</var>.</p> <!-- it's a clone of /cloned data/, not /data/,
+ so that there's no risk of running scripts again -->
</li>
@@ -71816,6 +71831,7 @@
</dd>
<!--DND-v4: (might want to prevent duplicates like for strings; see above)
+[make sure that the cloning happens before any side-effects can happen]
<dt>Otherwise
<dd>
@@ -71906,7 +71922,7 @@
</dd>
<!-- DND-v4:
- <dt><var title="">file</var> = <var title="">item</var> . <code title="dom-DataTransferItem-getAsFile">getAsFile</code>()</dt>
+ <dt><var title="">file</var> = <var title="">item</var> . <code title="dom-DataTransferItem-getAsObject">getAsObject</code>()</dt>
<dd>
<p>Invokes the callback with the cloned object data as the argument, if <span>the drag data item kind</span> is <i>Plain Unicode string</i> or <i>Object</i>.</p>
@@ -80170,13 +80186,6 @@
(if any), then throw an <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code>
exception.</li>
- <li><p>If there is no <var title="">target port</var> (i.e. if <var title="">source port</var> is not entangled), then abort these
- steps.</li>
- <!-- we don't raise an exception if there is no target port because
- this can happen at a moment's 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>Create an event that uses the <code><a href=#messageevent>MessageEvent</a></code>
interface, with the name <code title=event-message><a href=#event-message>message</a></code>, which does not bubble, is not
cancelable, and has no default action.</li>
@@ -80222,6 +80231,15 @@
</ol></li>
+ <li><p>If there is no <var title="">target port</var> (i.e. if <var title="">source port</var> is not entangled), then abort these
+ steps.</li> <!-- we don't raise an exception if there is no
+ target port because this can happen at a moment's notice. we don't
+ return false because if the port is _about_ to be closed, the
+ message might not be listened for anyway. we don't do this before
+ the steps above because otherwise you can tell the difference (in
+ whether the ports have become useless, or in when the structured
+ clone algorithm runs scripts -->
+
<li><p>Add the event to the <a href=#port-message-queue>port message queue</a> of <var title="">target port</var>.</li>
</ol><!--
Modified: index
===================================================================
--- index 2011-06-03 19:40:10 UTC (rev 6184)
+++ index 2011-06-03 20:20:17 UTC (rev 6185)
@@ -8448,14 +8448,19 @@
<li><p>Let <var title="">output</var> be the value resulting from
calling the <a href=#internal-structured-cloning-algorithm>internal structured cloning algorithm</a> with
- <var title="">input</var> and <var title="">memory</var>.</li>
+ <var title="">input</var> as the "<var title="">input</var>"
+ argument, <var title="">memory</var> as the "<var title="">memory</var>" argument, and zero as the "<var title="">depth</var>" argument.</li>
<li><p>Return <var title="">output</var>.</li>
</ol><p>The <dfn id=internal-structured-cloning-algorithm>internal structured cloning algorithm</dfn> is always
- called with two arguments, <var title="">input</var> and <var title="">memory</var>, and its behavior is as follows:</p>
+ called with three arguments, <var title="">input</var>, <var title="">memory</var>, and <var title="">depth</var>, and its
+ behavior is as follows:</p>
- <ol><li><p>If <var title="">input</var> is the source object of a pair
+ <ol><li><p>If <var title="">depth</var> is greater than 1, return null
+ and abort these steps.</li>
+
+ <li><p>If <var title="">input</var> is the source object of a pair
of objects in <var title="">memory</var>, then return the
destination object in that pair of objects and abort these
steps.</li>
@@ -8541,9 +8546,17 @@
object, then, for each enumerable property in <var title="">input</var>, add a new property to <var title="">output</var> having the same name, and having a value
created from invoking the <a href=#internal-structured-cloning-algorithm>internal structured cloning
algorithm</a> recursively with the value of the property as the
- "<var title="">input</var>" argument and <var title="">memory</var> as the "<var title="">memory</var>"
- argument. The order of the properties in the <var title="">input</var> and <var title="">output</var> objects must
- be the same.</p>
+ "<var title="">input</var>" argument, <var title="">memory</var>
+ as the "<var title="">memory</var>" argument, and <span title=""><var title="">depth</var>+<var title="">newDepth</var></span> as the "<var title="">depth</var>"
+ argument, where <var title="">newDepth</var> is zero except if
+ obtaining the value of the property involved executing script, in
+ which case it is one (1). The order of the properties in the <var title="">input</var> and <var title="">output</var> objects must
+ be the same, and any properties that involve running script must
+ be processed in that same order. If obtaining the value of the
+ property involved executing script, and that script threw an
+ uncaught exception, then abort the overall <a href=#structured-clone>structured
+ clone</a> algorithm, with that exception being passed through
+ to the caller.</p>
<p class=note>This does not walk the prototype chain.</p>
@@ -62719,7 +62732,7 @@
<p>When either of these methods is invoked, the user agent must run
the following steps:</p>
- <ol><li><p>Let <var title="">clone data</var> be a <a href=#structured-clone>structured
+ <ol><li><p>Let <var title="">cloned data</var> be a <a href=#structured-clone>structured
clone</a> of the specified <var title="">data</var>. If this
throws an exception, then rethrow that exception and abort these
steps.</li>
@@ -62816,8 +62829,10 @@
<li>
- <p>Set <code title=dom-history-state><a href=#dom-history-state>history.state</a></code> to
- another <a href=#structured-clone>structured clone</a> of the specified <var title="">data</var>.</p>
+ <p>Set <code title=dom-history-state><a href=#dom-history-state>history.state</a></code> to a
+ <a href=#structured-clone>structured clone</a> of <var title="">cloned
+ data</var>.</p> <!-- it's a clone of /cloned data/, not /data/,
+ so that there's no risk of running scripts again -->
</li>
@@ -71831,6 +71846,7 @@
</dd>
<!--DND-v4: (might want to prevent duplicates like for strings; see above)
+[make sure that the cloning happens before any side-effects can happen]
<dt>Otherwise
<dd>
@@ -71921,7 +71937,7 @@
</dd>
<!-- DND-v4:
- <dt><var title="">file</var> = <var title="">item</var> . <code title="dom-DataTransferItem-getAsFile">getAsFile</code>()</dt>
+ <dt><var title="">file</var> = <var title="">item</var> . <code title="dom-DataTransferItem-getAsObject">getAsObject</code>()</dt>
<dd>
<p>Invokes the callback with the cloned object data as the argument, if <span>the drag data item kind</span> is <i>Plain Unicode string</i> or <i>Object</i>.</p>
@@ -76610,13 +76626,6 @@
(if any), then throw an <code><a href=#invalid_state_err>INVALID_STATE_ERR</a></code>
exception.</li>
- <li><p>If there is no <var title="">target port</var> (i.e. if <var title="">source port</var> is not entangled), then abort these
- steps.</li>
- <!-- we don't raise an exception if there is no target port because
- this can happen at a moment's 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>Create an event that uses the <code><a href=#messageevent>MessageEvent</a></code>
interface, with the name <code title=event-message><a href=#event-message>message</a></code>, which does not bubble, is not
cancelable, and has no default action.</li>
@@ -76662,6 +76671,15 @@
</ol></li>
+ <li><p>If there is no <var title="">target port</var> (i.e. if <var title="">source port</var> is not entangled), then abort these
+ steps.</li> <!-- we don't raise an exception if there is no
+ target port because this can happen at a moment's notice. we don't
+ return false because if the port is _about_ to be closed, the
+ message might not be listened for anyway. we don't do this before
+ the steps above because otherwise you can tell the difference (in
+ whether the ports have become useless, or in when the structured
+ clone algorithm runs scripts -->
+
<li><p>Add the event to the <a href=#port-message-queue>port message queue</a> of <var title="">target port</var>.</li>
</ol><!--
Modified: source
===================================================================
--- source 2011-06-03 19:40:10 UTC (rev 6184)
+++ source 2011-06-03 20:20:17 UTC (rev 6185)
@@ -8555,18 +8555,25 @@
<li><p>Let <var title="">output</var> be the value resulting from
calling the <span>internal structured cloning algorithm</span> with
- <var title="">input</var> and <var title="">memory</var>.</p></li>
+ <var title="">input</var> as the "<var title="">input</var>"
+ argument, <var title="">memory</var> as the "<var
+ title="">memory</var>" argument, and zero as the "<var
+ title="">depth</var>" argument.</p></li>
<li><p>Return <var title="">output</var>.</p></li>
</ol>
<p>The <dfn>internal structured cloning algorithm</dfn> is always
- called with two arguments, <var title="">input</var> and <var
- title="">memory</var>, and its behavior is as follows:</p>
+ called with three arguments, <var title="">input</var>, <var
+ title="">memory</var>, and <var title="">depth</var>, and its
+ behavior is as follows:</p>
<ol>
+ <li><p>If <var title="">depth</var> is greater than 1, return null
+ and abort these steps.</p></li>
+
<li><p>If <var title="">input</var> is the source object of a pair
of objects in <var title="">memory</var>, then return the
destination object in that pair of objects and abort these
@@ -8661,11 +8668,20 @@
title="">output</var> having the same name, and having a value
created from invoking the <span>internal structured cloning
algorithm</span> recursively with the value of the property as the
- "<var title="">input</var>" argument and <var
- title="">memory</var> as the "<var title="">memory</var>"
- argument. The order of the properties in the <var
+ "<var title="">input</var>" argument, <var title="">memory</var>
+ as the "<var title="">memory</var>" argument, and <span
+ title=""><var title="">depth</var>+<var
+ title="">newDepth</var></span> as the "<var title="">depth</var>"
+ argument, where <var title="">newDepth</var> is zero except if
+ obtaining the value of the property involved executing script, in
+ which case it is one (1). The order of the properties in the <var
title="">input</var> and <var title="">output</var> objects must
- be the same.</p>
+ be the same, and any properties that involve running script must
+ be processed in that same order. If obtaining the value of the
+ property involved executing script, and that script threw an
+ uncaught exception, then abort the overall <span>structured
+ clone</span> algorithm, with that exception being passed through
+ to the caller.</p>
<p class="note">This does not walk the prototype chain.</p>
@@ -71484,7 +71500,7 @@
<ol>
- <li><p>Let <var title="">clone data</var> be a <span>structured
+ <li><p>Let <var title="">cloned data</var> be a <span>structured
clone</span> of the specified <var title="">data</var>. If this
throws an exception, then rethrow that exception and abort these
steps.</p></li>
@@ -71605,9 +71621,10 @@
<li>
- <p>Set <code title="dom-history-state">history.state</code> to
- another <span>structured clone</span> of the specified <var
- title="">data</var>.</p>
+ <p>Set <code title="dom-history-state">history.state</code> to a
+ <span>structured clone</span> of <var title="">cloned
+ data</var>.</p> <!-- it's a clone of /cloned data/, not /data/,
+ so that there's no risk of running scripts again -->
</li>
@@ -82038,6 +82055,7 @@
</dd>
<!--DND-v4: (might want to prevent duplicates like for strings; see above)
+[make sure that the cloning happens before any side-effects can happen]
<dt>Otherwise
<dd>
@@ -82134,7 +82152,7 @@
</dd>
<!-- DND-v4:
- <dt><var title="">file</var> = <var title="">item</var> . <code title="dom-DataTransferItem-getAsFile">getAsFile</code>()</dt>
+ <dt><var title="">file</var> = <var title="">item</var> . <code title="dom-DataTransferItem-getAsObject">getAsObject</code>()</dt>
<dd>
<p>Invokes the callback with the cloned object data as the argument, if <span>the drag data item kind</span> is <i>Plain Unicode string</i> or <i>Object</i>.</p>
@@ -91094,14 +91112,6 @@
(if any), then throw an <code>INVALID_STATE_ERR</code>
exception.</p></li>
- <li><p>If there is no <var title="">target port</var> (i.e. if <var
- title="">source port</var> is not entangled), then abort these
- steps.</p></li>
- <!-- we don't raise an exception if there is no target port because
- this can happen at a moment's 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>Create an event that uses the <code>MessageEvent</code>
interface, with the name <code
title="event-message">message</code>, which does not bubble, is not
@@ -91157,6 +91167,16 @@
</li>
+ <li><p>If there is no <var title="">target port</var> (i.e. if <var
+ title="">source port</var> is not entangled), then abort these
+ steps.</p></li> <!-- we don't raise an exception if there is no
+ target port because this can happen at a moment's notice. we don't
+ return false because if the port is _about_ to be closed, the
+ message might not be listened for anyway. we don't do this before
+ the steps above because otherwise you can tell the difference (in
+ whether the ports have become useless, or in when the structured
+ clone algorithm runs scripts -->
+
<li><p>Add the event to the <span>port message queue</span> of <var
title="">target port</var>.</p></li>
More information about the Commit-Watchers
mailing list