- From: poot <cvsmail@w3.org>
- Date: Wed, 03 Aug 2011 19:03:52 -0400
- To: public-html-diffs@w3.org
hixie: Document the setter on <select> and <select>.options (whatwg r6360) http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.5082&r2=1.5083&f=h http://html5.org/tools/web-apps-tracker?from=6359&to=6360 =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.5082 retrieving revision 1.5083 diff -u -d -r1.5082 -r1.5083 --- Overview.html 3 Aug 2011 07:19:05 -0000 1.5082 +++ Overview.html 3 Aug 2011 23:03:41 -0000 1.5083 @@ -6981,6 +6981,7 @@ // inherits <span title="dom-HTMLCollection-item">item</span>() attribute unsigned long <a href="#dom-htmloptionscollection-length" title="dom-HTMLOptionsCollection-length">length</a>; // overrides inherited length caller getter object? <a href="#dom-htmloptionscollection-nameditem" title="dom-HTMLOptionsCollection-namedItem">namedItem</a>(in DOMString name); // overrides inherited namedItem() + <a href="#dom-htmloptionscollection-setter" title="dom-HTMLOptionsCollection-setter">setter creator</a> void (in unsigned long index, in <a href="#htmloptionelement">HTMLOptionElement</a> option); void <a href="#dom-htmloptionscollection-add" title="dom-HTMLOptionsCollection-add">add</a>(in <a href="#htmlelement">HTMLElement</a> element, in optional <a href="#htmlelement">HTMLElement</a>? before); void <a href="#dom-htmloptionscollection-add" title="dom-HTMLOptionsCollection-add">add</a>(in <a href="#htmlelement">HTMLElement</a> element, in long before); void <a href="#dom-htmloptionscollection-remove" title="dom-HTMLOptionsCollection-remove">remove</a>(in long index); @@ -7054,7 +7055,7 @@ <code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code> is rooted, where <var title="">n</var> is the difference between the two numbers (new value minus old value). Mutation events must be fired as if a <code><a href="#documentfragment">DocumentFragment</a></code> containing the new <code><a href="#the-option-element">option</a></code> - elements had been inserted. If the new value is lower, then the + elements had been inserted. If the new value is lower, then the last <var title="">n</var> nodes in the collection must be removed from their parent nodes, where <var title="">n</var> is the difference between the two numbers (old value minus new value).</p> @@ -7088,6 +7089,28 @@ <li>Return that <code><a href="#nodelist">NodeList</a></code> object.</li> + </ol><p>When the user agent is to <dfn id="dom-htmloptionscollection-setter" title="dom-HTMLOptionsCollection-setter">set the value of a new + indexed property</dfn> for a given property index <var title="">index</var> to a new value <var title="">value</var>, it + must run the following algorithm:</p> + + <ol><li><p>Let <var title="">length</var> be the number of nodes + <a href="#represented-by-the-collection">represented by the collection</a>.</li> + + <li><p>Let <var title="">n</var> be <var title="">index</var> minus + <var title="">length</var>.</li> + + <li><p>If <var title="">n</var> is greater than one, then append + <var title="">n</var> new <code><a href="#the-option-element">option</a></code> elements with no + attributes and no child nodes to the <code><a href="#the-select-element">select</a></code> element on + which the <code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code> is rooted. Mutation + events must be fired as if a <code><a href="#documentfragment">DocumentFragment</a></code> + containing the new <code><a href="#the-option-element">option</a></code> elements had been + inserted.</li> + + <li><p>If <var title="">n</var> is zero, append <var title="">value</var> to the <code><a href="#the-select-element">select</a></code> element. Otherwise, + replace the <var title="">index</var>th element in the collection + by <var title="">value</var>.</li> + </ol><p>The <dfn id="dom-htmloptionscollection-add" title="dom-HTMLOptionsCollection-add"><code>add(<var title="">element</var>, <var title="">before</var>)</code></dfn> method must act according to the following algorithm:</p> @@ -36380,6 +36403,7 @@ void <a href="#dom-select-add" title="dom-select-add">add</a>(in <a href="#htmlelement">HTMLElement</a> element, in optional <a href="#htmlelement">HTMLElement</a>? before); void <a href="#dom-select-add" title="dom-select-add">add</a>(in <a href="#htmlelement">HTMLElement</a> element, in long before); void <a href="#dom-select-remove" title="dom-select-remove">remove</a>(in long index); + <a href="#dom-htmloptionscollection-setter" title="dom-HTMLOptionsCollection-setter">setter creator</a> void (in unsigned long index, in <a href="#htmloptionelement">HTMLOptionElement</a> option); readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-select-selectedoptions" title="dom-select-selectedOptions">selectedOptions</a>; attribute long <a href="#dom-select-selectedindex" title="dom-select-selectedIndex">selectedIndex</a>; @@ -36655,6 +36679,12 @@ returned by the method of the same name on the <code title="dom-select-options"><a href="#dom-select-options">options</a></code> collection, when invoked with the same argument.</p> + <p>When the user agent is to <dfn id="dom-htmlselectelement-setter" title="dom-HTMLSelectElement-setter">set the value of a new indexed + property</dfn> for a given property index <var title="">index</var> + to a new value <var title="">value</var>, it must instead <a href="#dom-htmloptionscollection-setter" title="dom-HTMLOptionsCollection-setter">set the value of a new + indexed property</a> with the given property index <var title="">index</var> to the new value <var title="">value</var> on the + <code title="dom-select-options"><a href="#dom-select-options">options</a></code> collection.</p> + <p>Similarly, the <dfn id="dom-select-add" title="dom-select-add"><code>add()</code></dfn> and <dfn id="dom-select-remove" title="dom-select-remove"><code>remove()</code></dfn> methods must act like their namesake methods on that same <code title="dom-select-options"><a href="#dom-select-options">options</a></code> collection.</p>
Received on Wednesday, 3 August 2011 23:03:57 UTC