- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 06 Oct 2010 22:46:36 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/spec In directory hutz:/tmp/cvs-serv3086 Modified Files: common-dom-interfaces.html spec.html Log Message: Make the structured clone algorithm support cycles. (whatwg r5587) [updated by splitter] Index: common-dom-interfaces.html =================================================================== RCS file: /sources/public/html5/spec/common-dom-interfaces.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- common-dom-interfaces.html 29 Sep 2010 19:16:48 -0000 1.21 +++ common-dom-interfaces.html 6 Oct 2010 22:46:34 -0000 1.22 @@ -1184,8 +1184,11 @@ <ol><li><p>Let <var title="">input</var> be the object being cloned.</p></li> - <li><p>Let <var title="">memory</var> be a list of objects, - initially empty. (This is used to catch cycles.)</p></li> + <li><p>Let <var title="">memory</var> be an association list of + pairs of objects, initially empty. This is used to handle duplicate + references. In each pair of objects, one is called the + <em>source</em> object and the other the <em>destination</em> + object.</p></li> <li><p>Let <var title="">output</var> be the object resulting from calling the <a href="#internal-structured-cloning-algorithm">internal structured cloning algorithm</a> with @@ -1194,122 +1197,108 @@ <li><p>Return <var title="">output</var>.</p></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 depends on the type of <var title="">input</var>, as follows:</p> - - <dl class="switch"><dt>If <var title="">input</var> is the undefined value</dt> - - <dd><p>Return the undefined value.</p></dd> - - <dt>If <var title="">input</var> is the null value</dt> - - <dd><p>Return the null value.</p></dd> - - <dt>If <var title="">input</var> is the false value</dt> - - <dd><p>Return the false value.</p></dd> - - <dt>If <var title="">input</var> is the true value</dt> + called with two arguments, <var title="">input</var> and <var title="">memory</var>, and its behavior is as follows:</p> - <dd><p>Return the true value.</p></dd> + <ol><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.</p></li> - <dt>If <var title="">input</var> is a number</dt> + <li><p>If <var title="">input</var> is a primitive value, then + return that value and abort these steps.</p></li> - <dd><p>Return the same number.</p></dd> + <li> - <dt>If <var title="">input</var> is a string</dt> + <p>The <var title="">input</var> value is an object. Jump to the + appropriate step below:</p> - <dd><p>Return the same string.</p></dd> + <dl class="switch"><dt>If <var title="">input</var> is a Boolean object</dt> - <dt>If <var title="">input</var> is a Boolean object</dt> + <dd><p>Let <var title="">output</var> be a newly constructed Boolean object with the same value as <var title="">input</var>.</p></dd> - <dd><p>Return a newly constructed Boolean object with the same value as <var title="">input</var>.</p></dd> + <dt>If <var title="">input</var> is a Number object</dt> - <dt>If <var title="">input</var> is a Number object</dt> + <dd><p>Let <var title="">output</var> be a newly constructed Number object with the same value as <var title="">input</var>.</p></dd> - <dd><p>Return a newly constructed Number object with the same value as <var title="">input</var>.</p></dd> + <dt>If <var title="">input</var> is a String object</dt> - <dt>If <var title="">input</var> is a String object</dt> + <dd><p>Let <var title="">output</var> be a newly constructed String object with the same value as <var title="">input</var>.</p></dd> - <dd><p>Return a newly constructed String object with the same value as <var title="">input</var>.</p></dd> + <dt>If <var title="">input</var> is a <code>Date</code> object</dt> - <dt>If <var title="">input</var> is a <code>Date</code> object</dt> + <dd><p>Let <var title="">output</var> be a newly constructed <code>Date</code> object with the same value as <var title="">input</var>.</p></dd> - <dd><p>Return a newly constructed <code>Date</code> object with the same value as <var title="">input</var>.</p></dd> + <dt>If <var title="">input</var> is a <code>RegExp</code> object</dt> - <dt>If <var title="">input</var> is a <code>RegExp</code> object</dt> + <dd> - <dd> + <p>Let <var title="">output</var> be a newly constructed <code>RegExp</code> object with the same pattern and flags as <var title="">input</var>.</p> - <p>Return a newly constructed <code>RegExp</code> object with the same pattern and flags as <var title="">input</var>.</p> + <p class="note">The value of the <code title="">lastIndex</code> property is not copied.</p> - <p class="note">The value of the <code title="">lastIndex</code> property is not copied.</p> + </dd> - </dd> + <dt>If <var title="">input</var> is a <code>ImageData</code> object</dt> - <dt>If <var title="">input</var> is a <code>ImageData</code> object</dt> + <dd><p>Let <var title="">output</var> be a newly constructed <code>ImageData</code> object + with the same <code title="dom-imagedata-width">width</code> and + <code title="dom-imagedata-height">height</code> as <var title="">input</var>, and with a newly constructed + <code>CanvasPixelArray</code> for its <code title="dom-imagedata-data">data</code> attribute, with the same + <code title="dom-canvaspixelarray-length">length</code> and pixel + values as the <var title="">input</var>'s.</p></dd> - <dd><p>Return a newly constructed <code>ImageData</code> object - with the same <code title="dom-imagedata-width">width</code> and - <code title="dom-imagedata-height">height</code> as <var title="">input</var>, and with a newly constructed - <code>CanvasPixelArray</code> for its <code title="dom-imagedata-data">data</code> attribute, with the same - <code title="dom-canvaspixelarray-length">length</code> and pixel - values as the <var title="">input</var>'s.</p></dd> + <dt>If <var title="">input</var> is a <code>File</code> object</dt> - <dt>If <var title="">input</var> is a <code>File</code> object</dt> + <dd><p>Let <var title="">output</var> be a newly constructed <code>File</code> object corresponding to the same underlying data.</p></dd> - <dd><p>Return a newly constructed <code>File</code> object corresponding to the same underlying data.</p></dd> + <dt>If <var title="">input</var> is a <code>Blob</code> object</dt> - <dt>If <var title="">input</var> is a <code>Blob</code> object</dt> + <dd><p>Let <var title="">output</var> be a newly constructed <code>Blob</code> object corresponding to the same underlying data.</p></dd> - <dd><p>Return a newly constructed <code>Blob</code> object corresponding to the same underlying data.</p></dd> + <dt>If <var title="">input</var> is a <code>FileList</code> object</dt> - <dt>If <var title="">input</var> is a <code>FileList</code> object</dt> + <dd><p>Let <var title="">output</var> be a newly constructed <code>FileList</code> object containing a list of newly constructed <code>File</code> objects corresponding to the same underlying data as those in <var title="">input</var>, maintaining their relative order.</p></dd> - <dd><p>Return a newly constructed <code>FileList</code> object containing a list of newly constructed <code>File</code> objects corresponding to the same underlying data as those in <var title="">input</var>, maintaining their relative order.</p></dd> + <dt>If <var title="">input</var> is an Array object</dt> - <dt>If <var title="">input</var> is an Array object</dt> - <dt>If <var title="">input</var> is an Object object</dt> + <dd><p>Let <var title="">output</var> be a newly constructed empty <code>Array</code> object.</p></dd> - <dd> + <dt>If <var title="">input</var> is an Object object</dt> - <ol><li><p>If <var title="">input</var> is in <var title="">memory</var>, then throw a <code><a href="#data_clone_err">DATA_CLONE_ERR</a></code> - exception and abort the overall <a href="#structured-clone">structured clone</a> - algorithm.</p></li> + <dd><p>Let <var title="">output</var> be a newly constructed empty <code><a href="the-iframe-element.html#the-object-element">Object</a></code> object.</p></dd> - <li><p>Otherwise, let <var title="">new memory</var> be a list - consisting of the items in <var title="">memory</var> with the - addition of <var title="">input</var>.</p></li> + <dt>If <var title="">input</var> is another native object type (e.g. <code>Error</code>, <code><a href="webappapis.html#function">Function</a></code>)</dt> + <dt>If <var title="">input</var> is a host object (e.g. a DOM node)</dt> - <li><p>Create a new object, <var title="">output</var>, of the - same type as <var title="">input</var>: either an Array or an - Object.</p></li> + <dd><p>Throw a <code><a href="#data_clone_err">DATA_CLONE_ERR</a></code> exception and abort + the overall <a href="#structured-clone">structured clone</a> algorithm.</p></dd> - <li> + </dl></li> - <p>For each enumerable property in <var title="">input</var>, - add a corresponding 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="">new - 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> + <li><p>Add a mapping from <var title="">input</var> (the source + object) to <var title="">output</var> (the destination object) to + <var title="">memory</var>.</p></li> - <p class="note">This does not walk the prototype chain.</p> + <li> - </li> + <p>If <var title="">input</var> is an Array object or an Object + object, then, for each enumerable property in <var title="">input</var>, add a corresponding 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> - <li><p>Return <var title="">output</var>.</p></li> + <p class="note">This does not walk the prototype chain.</p> - </ol></dd> + </li> - <dt>If <var title="">input</var> is another native object type (e.g. <code>Error</code>, <code><a href="webappapis.html#function">Function</a></code>)</dt> - <dt>If <var title="">input</var> is a host object (e.g. a DOM node)</dt> + <li><p>Return <var title="">output</var>.</p></li> - <dd><p>Throw a <code><a href="#data_clone_err">DATA_CLONE_ERR</a></code> exception and abort the - overall <a href="#structured-clone">structured clone</a> algorithm.</p></dd> + </ol><p class="note">This algorithm preserves cycles and preserves the + identity of duplicate objects in graphs.</p> - </dl></div><h4 id="domstringmap-0"><span class="secno">2.8.6 </span>DOMStringMap</h4><p>The <code><a href="#domstringmap">DOMStringMap</a></code> interface represents a set of + </div><h4 id="domstringmap-0"><span class="secno">2.8.6 </span>DOMStringMap</h4><p>The <code><a href="#domstringmap">DOMStringMap</a></code> interface represents a set of name-value pairs. It exposes these using the scripting language's native mechanisms for property access.</p><div class="impl"> Index: spec.html =================================================================== RCS file: /sources/public/html5/spec/spec.html,v retrieving revision 1.1273 retrieving revision 1.1274 diff -u -d -r1.1273 -r1.1274 --- spec.html 6 Oct 2010 21:16:34 -0000 1.1273 +++ spec.html 6 Oct 2010 22:46:34 -0000 1.1274 @@ -341,7 +341,7 @@ <a href="Overview.html">single page HTML</a>, <a href="spec.html">multipage HTML</a>, <a href="author/">web developer edition</a>. -This is revision 1.4464. +This is revision 1.4465. </p> <p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2010 <a href="http://www.w3.org/"><abbr title="World Wide
Received on Wednesday, 6 October 2010 22:46:39 UTC