- From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 07 Oct 2008 04:55:02 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/spec In directory hutz:/tmp/cvs-serv5504 Modified Files: Overview.html Log Message: WF2: select.add, select.remove, select.options.add, select.options.remove (whatwg r2290) Index: Overview.html =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.1462 retrieving revision 1.1463 diff -u -d -r1.1462 -r1.1463 --- Overview.html 6 Oct 2008 10:37:59 -0000 1.1462 +++ Overview.html 7 Oct 2008 04:55:00 -0000 1.1463 @@ -8,7 +8,7 @@ <p><a href=http://www.w3.org/><img alt=W3C height=48 src=http://www.w3.org/Icons/w3c_home width=72></a></p> <h1>HTML 5</h1> <h2 class="no-num no-toc" id=a-vocabulary-and-associated-apis-for-html-and-xhtml>A vocabulary and associated APIs for HTML and XHTML</h2> - <h2 class="no-num no-toc" id=editor-s-draft-date-zzz-9-june-2008><!-- "W3C Working Draft" --> Editor's Draft <!--ZZZ-->6 October 2008</h2> + <h2 class="no-num no-toc" id=editor-s-draft-date-zzz-9-june-2008><!-- "W3C Working Draft" --> Editor's Draft <!--ZZZ-->7 October 2008</h2> <dl><!-- ZZZ: update the month/day <dt>This Version:</dt> <dd><a href="http://www.w3.org/TR/2008/WD-html5-20080609/">http://www.w3.org/TR/2008/WD-html5-20080609/</a></dd> @@ -100,7 +100,7 @@ specification's progress along the W3C Recommendation track. <!--ZZZ:--> - This specification is the 6 October 2008 <!--ZZZ "Working Draft"-->Editor's Draft. + This specification is the 7 October 2008 <!--ZZZ "Working Draft"-->Editor's Draft. <!--:ZZZ--> </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><p>This specification is also being produced by the <a href=http://www.whatwg.org/>WHATWG</a>. The two specifications are identical from the table of contents onwards.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- context and rationale (required) --><p>This specification is intended to replace (be a new version of) @@ -4278,11 +4278,16 @@ </ol><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E...%0A%3Cform%20name%3D%22a%22%3E%3Cinput%20id%3D%22x%22%20name%3D%22y%22%3E%3Cinput%20name%3D%22x%22%20id%3D%22y%22%3E%3C/form%3E%0A%3Cscript%3E%0A%20%20var%20x%3B%0A%20%20w%28x%20%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20x%5B0%5D.parentNode.removeChild%28x%5B0%5D%29%3B%0A%20%20w%28x.length%29%3B%0A%20%20w%28x%20%3D%3D%20document.forms%5B%27a%27%5D%5B%27x%27%5D%29%3B%0A%3C/script%3E%0A ---><h5 id=htmloptionscollection><span class=secno>2.8.2.3 </span>HTMLOptionsCollection</h5><p>The <code><a href=#htmloptionscollection-0>HTMLOptionsCollection</a></code> interface represents - a list of <code><a href=#the-option-element>option</a></code> elements.<pre class=idl>interface <dfn id=htmloptionscollection-0>HTMLOptionsCollection</dfn> { +--><h5 id=htmloptionscollection><span class=secno>2.8.2.3 </span>HTMLOptionsCollection</h5><p>The <code><a href=#htmloptionscollection-0>HTMLOptionsCollection</a></code> interface represents a + list of <code><a href=#the-option-element>option</a></code> elements. It is always rooted on a + <code><a href=#the-select-element>select</a></code> element and has attributes and methods that + manipulate that element's descendants.<pre class=idl>interface <dfn id=htmloptionscollection-0>HTMLOptionsCollection</dfn> { attribute unsigned long <a href=#dom-htmloptionscollection-length title=dom-HTMLOptionsCollection-length>length</a>; [IndexGetter] <a href=#htmloptionelement>HTMLOptionElement</a> <a href=#dom-htmloptionscollection-item title=dom-HTMLOptionsCollection-item>item</a>(in unsigned long index); [NameGetter] Object <a href=#dom-htmloptionscollection-nameditem title=dom-HTMLOptionsCollection-namedItem>namedItem</a>(in DOMString name); + void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(in <a href=#htmlelement>HTMLElement</a> element, in <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); };</pre><p>On getting, the <dfn id=dom-htmloptionscollection-length title=dom-HTMLOptionsCollection-length><code>length</code></dfn> attribute must return the number of nodes <a href=#represented-by-the-collection>represented by the collection</a>.<p>On setting, the behavior depends on whether the new value is @@ -4321,10 +4326,47 @@ <li>Return that <code>NodeList</code> object.</li> - </ol><!-- see also http://ln.hixie.ch/?start=1161042744&count=1 --><p class=XXX>We may want to add <code>add()</code> and - <code>remove()</code> methods here too because IE implements - HTMLSelectElement and HTMLOptionsCollection on the same object, and - so people use them almost interchangeably in the wild.<h4 id=domtokenlist><span class=secno>2.8.3 </span>DOMTokenList</h4><p>The <code><a href=#domtokenlist-0>DOMTokenList</a></code> interface represents an interface + </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:<ol><li><p>If <var title="">element</var> is not an <code><a href=#the-option-element>option</a></code> + or <code><a href=#the-optgroup-element>optgroup</a></code> element, then return and abort these + steps.</li> + + <li><p>If <var title="">element</var> is an ancestor of the + <code><a href=#the-select-element>select</a></code> element element on which the + <code><a href=#htmloptionscollection-0>HTMLOptionsCollection</a></code> is rooted, then throw a + <code>HIERARCHY_REQUEST_ERR</code> exception.</li> + + <li><p>If <var title="">before</var> is an element, but that + element isn't a descendant of the <code><a href=#the-select-element>select</a></code> element + element on which the <code><a href=#htmloptionscollection-0>HTMLOptionsCollection</a></code> is rooted, + then throw a <code>NOT_FOUND_ERR</code> exception.</li> + + <li><p>If <var title="">element</var> and <var title="">before</var> are the same element, then return and abort + these steps.</li> + + <li><p>If <var title="">before</var> is a node, then let <var title="">reference</var> be that node. Otherwise, if <var title="">before</var> is an integer, and there is a <var title="">before</var>th node in the collection, let <var title="">reference</var> be that node. Otherwise, let <var title="">reference</var> be null.</li> + + <li><p>If <var title="">reference</var> is not null, let <var title="">parent</var> be the parent node of <var title="">reference</var>. Otherwise, let <var title="">parent</var> + be the <code><a href=#the-select-element>select</a></code> element element on which the + <code><a href=#htmloptionscollection-0>HTMLOptionsCollection</a></code> is rooted.</li> + + <li><p>Act as if the DOM Core <code title=dom-insertBefore>insertBefore()</code> method was invoked + on the <var title="">parent</var> node, with <var title="">element</var> as the first argument and <var title="">reference</var> as the second argument.</p> + + </ol><p>The <dfn id=dom-htmloptionscollection-remove title=dom-HTMLOptionsCollection-remove><code>remove(<var title="">index</var>)</code></dfn> method must act according to + the following algorithm:<ol><li><p>If the number of nodes <a href=#represented-by-the-collection>represented by the + collection</a> is zero, abort these steps.</li> + + <li><p>If <var title="">index</var> is not a number greater than or + equal to 0 and less than the number of nodes <a href=#represented-by-the-collection>represented by + the collection</a>, let <var title="">element</var> be the first + element in the collection. Otherwise, let <var title="">element</var> be the <var title="">index</var>th element + in the collection.</li> + + <li><p>Remove <var title="">element</var> from its parent + node.</li> + + </ol><!-- see also http://ln.hixie.ch/?start=1161042744&count=1 --><h4 id=domtokenlist><span class=secno>2.8.3 </span>DOMTokenList</h4><p>The <code><a href=#domtokenlist-0>DOMTokenList</a></code> interface represents an interface to an underlying string that consists of an <a href=#unordered-set-of-unique-space-separated-tokens>unordered set of unique space-separated tokens</a>.<p>Which string underlies a particular <code><a href=#domtokenlist-0>DOMTokenList</a></code> object is defined when the object is created. It might be a content @@ -21094,16 +21136,16 @@ readonly attribute DOMString <a href=#dom-select-type title=dom-select-type>type</a>; readonly attribute <a href=#htmloptionscollection-0>HTMLOptionsCollection</a> <a href=#dom-select-options title=dom-select-options>options</a>; - attribute unsigned long <span title=dom-select-length>length</span>; + attribute unsigned long <a href=#dom-select-length title=dom-select-length>length</a>; [IndexGetter] <a href=#htmlelement>HTMLElement</a> <span title=dom-select-XXX9>XXX9</span>(in unsigned long index); + void <a href=#dom-select-add title=dom-select-add>add</a>(in <a href=#htmlelement>HTMLElement</a> element, in <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); readonly attribute <a href=#htmloptionscollection-0>HTMLOptionsCollection</a> <span title=dom-select-selectedOptions>selectedOptions</span>; attribute long <span title=dom-select-selectedIndex>selectedIndex</span>; attribute DOMString <span title=dom-select-value>value</span>; - void <span title=dom-select-add>add</span>(in <a href=#htmlelement>HTMLElement</a> element, in <a href=#htmlelement>HTMLElement</a> before); - void <span title=dom-select-remove>remove</span>(in long index); - readonly attribute boolean <a href=#dom-cva-willvalidate title=dom-cva-willValidate>willValidate</a>; readonly attribute <span>ValidityState</span> <a href=#dom-cva-validity title=dom-cva-validity>validity</a>; readonly attribute DOMString <a href=#dom-cva-validationmessage title=dom-cva-validationMessage>validationMessage</a>; @@ -21145,23 +21187,22 @@ attribute represents the element's name. The <code title=attr-fe-disabled><a href=#attr-fe-disabled>disabled</a></code> attribute is used to make the control non-interactive and to prevent its value from being submitted. The <code title=attr-fe-autofocus><a href=#attr-fe-autofocus>autofocus</a></code> - attribute controls focus.<p>The <dfn id=dom-select-type title=dom-select-type><code>type</code></dfn> + attribute controls focus.<p>The <dfn id=dom-select-type title=dom-select-type><code>type</code></dfn> DOM attribute, on getting, must return the string "<code title="">select-one</code>" if the <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is absent, and the string "<code title="">select-multiple</code>" if the <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code> attribute is present.<p>The <dfn id=dom-select-options title=dom-select-options><code>options</code></dfn> - attribute must return an <code><a href=#htmloptionscollection-0>HTMLOptionsCollection</a></code> rooted - at the <code><a href=#the-select-element>select</a></code> node, whose filter matches the elements - in the <a href=#concept-select-option-list title=concept-select-option-list>list of - options</a>.</p><!-- XXX - attribute unsigned long <span title="dom-select-length">length</span>; - [IndexGetter] <span>HTMLElement</span> <span title="dom-select-XXX9">XXX9</span>(in unsigned long index); - + DOM attribute must return an <code><a href=#htmloptionscollection-0>HTMLOptionsCollection</a></code> + rooted at the <code><a href=#the-select-element>select</a></code> node, whose filter matches the + elements in the <a href=#concept-select-option-list title=concept-select-option-list>list of + options</a>.<p>The <dfn id=dom-select-length title=dom-select-length><code>length</code></dfn> DOM + attribute, on getting and setting, must act like the <code title=dom-HTMLOptionsCollection-length><a href=#dom-htmloptionscollection-length>length</a></code> attribute on + the <code><a href=#htmloptionscollection-0>HTMLOptionsCollection</a></code> object return by the <code title=dom-select-options><a href=#dom-select-options>options</a></code> attribute. 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><a href=#htmloptionscollection-0>HTMLOptionsCollection</a></code> object.</p><!-- XXX9 is blocked on WebIDL --><!-- XXX readonly attribute <span>HTMLOptionsCollection</span> <span title="dom-select-selectedOptions">selectedOptions</span>; attribute long <span title="dom-select-selectedIndex">selectedIndex</span>; attribute DOMString <span title="dom-select-value">value</span>; - - void <span title="dom-select-add">add</span>(in <span>HTMLElement</span> element, in <span>HTMLElement</span> before); - void <span title="dom-select-remove">remove</span>(in long index); --><p class=XXX>...<p>The <dfn id=dom-select-multiple title=dom-select-multiple><code>multiple</code></dfn> and <dfn id=dom-select-size title=dom-select-size><code>size</code></dfn> DOM attributes must <a href=#reflect>reflect</a> the respective content
Received on Tuesday, 7 October 2008 04:55:38 UTC