- From: poot <cvsmail@w3.org>
- Date: Fri, 21 Oct 2011 17:37:07 -0400
- To: public-html-diffs@w3.org
hixie: Try to make the named getter on HTMLFormElement more Web- compatible. (whatwg r6727) http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.5392&r2=1.5393&f=h http://html5.org/tools/web-apps-tracker?from=6726&to=6727 =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.5392 retrieving revision 1.5393 diff -u -d -r1.5392 -r1.5393 --- Overview.html 21 Oct 2011 16:42:29 -0000 1.5392 +++ Overview.html 21 Oct 2011 21:36:48 -0000 1.5393 @@ -31752,8 +31752,11 @@ <dd> - <p>Returns the form control in the form with the given <a href="#concept-id" title="concept-id">ID</a> or <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> (excluding image buttons for - historical reasons).</p> + <p>Returns the form control (or, if there are several, a + <code><a href="#nodelist">NodeList</a></code> of the form controls) in the form with the + given <a href="#concept-id" title="concept-id">ID</a> or <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> (excluding image buttons for + historical reasons); or, if there are none, returns the + <code><a href="#the-img-element">img</a></code> element with the given ID.</p> <p>Once an element has been referenced using a particular name, that name will continue being available as a way to reference that @@ -31826,47 +31829,52 @@ the <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> collection, when invoked with the given index as its argument.</p> - <p>Each <code><a href="#the-form-element">form</a></code> element has a mapping of names to elements + <hr><p>Each <code><a href="#the-form-element">form</a></code> element has a mapping of names to elements called the <dfn id="past-names-map">past names map</dfn>. It is used to persist names of controls even when they change names.</p> - <p>The <a href="#supported-property-names">supported property names</a> are the union of the - names currently supported by the object returned by the <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> attribute, and the names - currently in the <a href="#past-names-map">past names map</a>.</p> + <p>The <a href="#supported-property-names">supported property names</a> consist of the values + of all the <code title="attr-id"><a href="#the-id-attribute">id</a></code> and <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attributes of all the <a href="#category-listed" title="category-listed">listed elements</a> and <code><a href="#the-img-element">img</a></code> + elements that are descendants of the <code><a href="#the-form-element">form</a></code> element, and + all the names currently in the <a href="#past-names-map">past names map</a>.</p> <p>When a <code><a href="#the-form-element">form</a></code> element is <dfn id="dom-form-nameditem" title="dom-form-namedItem">indexed for named property retrieval</dfn>, the user agent must run the following steps:</p> - <ol><li> - - <p>If <var title="">name</var> is one of the <a href="#supported-property-names">supported - property names</a> of the object returned by the <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> attribute, then run - these substeps:</p> + <ol><li><p>Let <var title="">candidates</var> be a <a href="#live">live</a> + <code><a href="#nodelist">NodeList</a></code> object containing all the <a href="#category-listed" title="category-listed">listed elements</a> that are descendants + of the <code><a href="#the-form-element">form</a></code> element and that have either an <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute or a <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute equal to <var title="">name</var>, in <a href="#tree-order">tree order</a>.</li> - <ol><li><p>Let <var title="">candidate</var> be the object returned - by the <code title="dom-HTMLFormControlsCollection-namedItem"><a href="#dom-htmlformcontrolscollection-nameditem">namedItem()</a></code> - method on the object returned by the <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> attribute when passed - the <var title="">name</var> argument.</li> + <li><p>If <var title="">candidates</var> is empty, let <var title="">candidates</var> be a <a href="#live">live</a> + <code><a href="#nodelist">NodeList</a></code> object containing all the <code><a href="#the-img-element">img</a></code> + elements that are descendants of the <code><a href="#the-form-element">form</a></code> element and + that have either an <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute or a + <code title="attr-img-name"><a href="#attr-img-name">name</a></code> attribute equal to <var title="">name</var>, in <a href="#tree-order">tree order</a>.</li> - <li><p>If <var title="">candidate</var> is an element, then add a - mapping from <var title="">name</var> to <var title="">candidate</var> in the <code><a href="#the-form-element">form</a></code> element's - <a href="#past-names-map">past names map</a>, replacing the previous entry with - the same name, if any.</li> + <li><p>If <var title="">candidates</var> is empty, <var title="">name</var> is the name of one of the entries in the + <code><a href="#the-form-element">form</a></code> element's <a href="#past-names-map">past names map</a>: return the + object associated with <var title="">name</var> in that + map.</li> - <li><p>Return <var title="">candidate</var> and abort these - steps.</li> + <li><p>If <var title="">candidates</var> contains more than one + node, return <var title="">candidates</var> and abort these + steps.</li> - </ol></li> + <li><p>Otherwise, <var title="">candidates</var> contains exactly + one node. Add a mapping from <var title="">name</var> to the node + in <var title="">candidates</var> in the <code><a href="#the-form-element">form</a></code> element's + <a href="#past-names-map">past names map</a>, replacing the previous entry with the + same name, if any.</li> - <li><p>Otherwise, <var title="">name</var> is the name of one of - the entries in the <code><a href="#the-form-element">form</a></code> element's <a href="#past-names-map">past names - map</a>: return the object associated with <var title="">name</var> in that map.</li> + <li><p>Return the node in <var title="">candidates</var>.</li> </ol><p>If an element listed in the <code><a href="#the-form-element">form</a></code> element's <a href="#past-names-map">past names map</a> is removed from the <code><a href="#document">Document</a></code>, then its entries must be removed from the map.</p> + + <hr><p>The <dfn id="dom-form-submit" title="dom-form-submit"><code>submit()</code></dfn> method, when invoked, must <a href="#concept-form-submit" title="concept-form-submit">submit</a> the <code><a href="#the-form-element">form</a></code> element from the <code><a href="#the-form-element">form</a></code> element itself, with the <var title="">submitted from <code title="dom-form-submit"><a href="#dom-form-submit">submit()</a></code> method</var> flag set.</p>
Received on Friday, 21 October 2011 21:37:14 UTC