Skip to content

Commit

Permalink
[e] (0) Revamp how <select> handles enumeration, for better compatibi…
Browse files Browse the repository at this point in the history
…lity with WebIDL and, to some very limited extent, IE. Full compatibility with IE here is impossible without me losing my sanity.

git-svn-id: http://svn.whatwg.org/webapps@2656 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 13, 2009
1 parent bbb049b commit 99d80ce
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 32 deletions.
38 changes: 24 additions & 14 deletions index
Expand Up @@ -28122,7 +28122,7 @@ You cannot complete this form until the field is correct.</samp></pre>
<dd><code title=attr-select-size><a href=#attr-select-size>size</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class=idl>[IndexGetter]
<pre class=idl>[Callable=<a href=#dom-select-nameditem title=dom-select-namedItem>namedItem</a>]
interface <dfn id=htmlselectelement>HTMLSelectElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
attribute boolean <a href=#dom-fe-autofocus title=dom-fe-autofocus>autofocus</a>;
attribute boolean <a href=#dom-fe-disabled title=dom-fe-disabled>disabled</a>;
Expand All @@ -28135,6 +28135,8 @@ interface <dfn id=htmlselectelement>HTMLSelectElement</dfn> : <a href=#htmleleme

readonly attribute <a href=#htmloptionscollection-0>HTMLOptionsCollection</a> <a href=#dom-select-options title=dom-select-options>options</a>;
attribute unsigned long <a href=#dom-select-length title=dom-select-length>length</a>;
[IndexGetter] any <a href=#dom-select-item title=dom-select-item>item</a>(in DOMString name);
[NameGetter] any <a href=#dom-select-nameditem title=dom-select-namedItem>namedItem</a>(in DOMString name);
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);
Expand Down Expand Up @@ -28276,20 +28278,28 @@ interface <dfn id=htmlselectelement>HTMLSelectElement</dfn> : <a href=#htmleleme
elements in the <a href=#concept-select-option-list title=concept-select-option-list>list of
options</a>.</p>

<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 returned 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>

<p>The <span>indices of the supported indexed properties</span> at
any instant are the indicies supported by the object returned by the
<p>The <code title=dom-select-options><a href=#dom-select-options>options</a></code> collection is
also mirrored on the <code><a href=#htmlselectelement>HTMLSelectElement</a></code> object. The <dfn id=dom-select-length title=dom-select-length><code>length</code></dfn> DOM attribute
must return the number of nodes <a href=#represented-by-the-collection title="represented by the
collection">represented</a> by the <code title=dom-select-options><a href=#dom-select-options>options</a></code> collection. The
<span>indices of the supported indexed properties</span> at any
instant are the indicies supported by the object returned by the
<code title=dom-select-options><a href=#dom-select-options>options</a></code> attribute at that
instant. The value of the <span>corresponding indexed
property</span> whenever an indexed property is retrieved is the
value of the <span>corresponding indexed property</span> on the
object returned by the <code title=dom-select-options><a href=#dom-select-options>options</a></code> attribute.</p>
instant. The <span>names of the supported named properties</span> at
any instant are the names supported by the object returned by the
<code title=dom-select-options><a href=#dom-select-options>options</a></code> attribute at that
instant.</p>

<p>The <dfn id=dom-select-item title=dom-select-item><code>item(<var title="">index</var>)</code></dfn> method must return the value
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>The <dfn id=dom-select-nameditem title=dom-select-namedItem><code>namedItem(<var title="">index</var>)</code></dfn> method must return the value
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>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>

<p>The <dfn id=dom-select-selectedoptions title=dom-select-selectedOptions><code>selectedOptions</code></dfn>
DOM attribute must return an <code><a href=#htmlcollection-0>HTMLCollection</a></code> rooted at
Expand Down
51 changes: 33 additions & 18 deletions source
Expand Up @@ -31504,7 +31504,7 @@ You cannot complete this form until the field is correct.</samp></pre>
<dd><code title="attr-select-size">size</code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">[IndexGetter]
<pre class="idl">[Callable=<span title="dom-select-namedItem">namedItem</span>]
interface <dfn>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
attribute boolean <span title="dom-fe-autofocus">autofocus</span>;
attribute boolean <span title="dom-fe-disabled">disabled</span>;
Expand All @@ -31517,6 +31517,8 @@ interface <dfn>HTMLSelectElement</dfn> : <span>HTMLElement</span> {

readonly attribute <span>HTMLOptionsCollection</span> <span title="dom-select-options">options</span>;
attribute unsigned long <span title="dom-select-length">length</span>;
[IndexGetter] any <span title="dom-select-item">item</span>(in DOMString name);
[NameGetter] any <span title="dom-select-namedItem">namedItem</span>(in DOMString name);
void <span title="dom-select-add">add</span>(in <span>HTMLElement</span> element, in <span>HTMLElement</span> before);
void <span title="dom-select-add">add</span>(in <span>HTMLElement</span> element, in long before);
void <span title="dom-select-remove">remove</span>(in long index);
Expand Down Expand Up @@ -31695,24 +31697,37 @@ interface <dfn>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
elements in the <span title="concept-select-option-list">list of
options</span>.</p>

<p>The <dfn title="dom-select-length"><code>length</code></dfn> DOM
attribute, on getting and setting, must act like the <code
title="dom-HTMLOptionsCollection-length">length</code> attribute on
the <code>HTMLOptionsCollection</code> object returned by the <code
title="dom-select-options">options</code> attribute. Similarly, the
<dfn title="dom-select-add"><code>add()</code></dfn> and <dfn
title="dom-select-remove"><code>remove()</code></dfn> methods must
act like their namesake methods on that same
<code>HTMLOptionsCollection</code> object.</p>

<p>The <span>indices of the supported indexed properties</span> at
any instant are the indicies supported by the object returned by the
<p>The <code title="dom-select-options">options</code> collection is
also mirrored on the <code>HTMLSelectElement</code> object. The <dfn
title="dom-select-length"><code>length</code></dfn> DOM attribute
must return the number of nodes <span title="represented by the
collection">represented</span> by the <code
title="dom-select-options">options</code> collection. The
<span>indices of the supported indexed properties</span> at any
instant are the indicies supported by the object returned by the
<code title="dom-select-options">options</code> attribute at that
instant. The value of the <span>corresponding indexed
property</span> whenever an indexed property is retrieved is the
value of the <span>corresponding indexed property</span> on the
object returned by the <code
title="dom-select-options">options</code> attribute.</p>
instant. The <span>names of the supported named properties</span> at
any instant are the names supported by the object returned by the
<code title="dom-select-options">options</code> attribute at that
instant.</p>

<p>The <dfn title="dom-select-item"><code>item(<var
title="">index</var>)</code></dfn> method must return the value
returned by the method of the same name on the <code
title="dom-select-options">options</code> collection, when invoked
with the same argument.</p>

<p>The <dfn title="dom-select-namedItem"><code>namedItem(<var
title="">index</var>)</code></dfn> method must return the value
returned by the method of the same name on the <code
title="dom-select-options">options</code> collection, when invoked
with the same argument.</p>

<p>Similarly, the <dfn
title="dom-select-add"><code>add()</code></dfn> and <dfn
title="dom-select-remove"><code>remove()</code></dfn> methods must
act like their namesake methods on that same <code
title="dom-select-options">options</code> collection.</p>

<p>The <dfn
title="dom-select-selectedOptions"><code>selectedOptions</code></dfn>
Expand Down

0 comments on commit 99d80ce

Please sign in to comment.