Skip to content

Commit

Permalink
[giow] (2) closer to existing implementations
Browse files Browse the repository at this point in the history
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=12861

git-svn-id: http://svn.whatwg.org/webapps@6440 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 12, 2011
1 parent 9dece61 commit 9e79e36
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 40 deletions.
24 changes: 11 additions & 13 deletions complete.html
Expand Up @@ -8344,8 +8344,10 @@ <h5 id=htmloptionscollection-0><span class=secno>2.8.2.3 </span>HTMLOptionsColle
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-add title=dom-HTMLOptionsCollection-add>add</a>(in <a href=#htmloptionelement>HTMLOptionElement</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=#htmloptgroupelement>HTMLOptGroupElement</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=#htmloptionelement>HTMLOptionElement</a> element, in long before);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(in <a href=#htmloptgroupelement>HTMLOptGroupElement</a> element, in long before);
void <a href=#dom-htmloptionscollection-remove title=dom-HTMLOptionsCollection-remove>remove</a>(in long index);
attribute long <a href=#dom-htmloptionscollection-selectedindex title=dom-HTMLOptionsCollection-selectedIndex>selectedIndex</a>;
};</pre>
Expand Down Expand Up @@ -8385,8 +8387,7 @@ <h5 id=htmloptionscollection-0><span class=secno>2.8.2.3 </span>HTMLOptionsColle
end of the list.</p>
<p>This method will throw a <code><a href=#hierarchy_request_err>HIERARCHY_REQUEST_ERR</a></code>
exception if <var title="">element</var> is an ancestor of the
element into which it is to be inserted. 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 the method does nothing.</p>
element into which it is to be inserted.</p>
</dd>

<dt><var title="">collection</var> . <code title=dom-HTMLOptionsCollection-selectedIndex><a href=#dom-htmloptionscollection-selectedindex>selectedIndex</a></code> [ = <var title="">value</var> ]</dt>
Expand Down Expand Up @@ -8479,11 +8480,7 @@ <h5 id=htmloptionscollection-0><span class=secno>2.8.2.3 </span>HTMLOptionsColle
</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>

<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
<ol><li><p>If <var title="">element</var> is an ancestor of the
<code><a href=#the-select-element>select</a></code> element on which the
<code><a href=#htmloptionscollection>HTMLOptionsCollection</a></code> is rooted, then throw a
<code><a href=#hierarchy_request_err>HIERARCHY_REQUEST_ERR</a></code> exception.</li>
Expand Down Expand Up @@ -48584,8 +48581,10 @@ <h4 id=the-select-element><span class=secno>4.10.9 </span>The <dfn><code>select<
attribute unsigned long <a href=#dom-select-length title=dom-select-length>length</a>;
getter any <a href=#dom-select-item title=dom-select-item>item</a>(in unsigned long index);
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 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-add title=dom-select-add>add</a>(in <a href=#htmloptionelement>HTMLOptionElement</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=#htmloptgroupelement>HTMLOptGroupElement</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=#htmloptionelement>HTMLOptionElement</a> element, in long before);
void <a href=#dom-select-add title=dom-select-add>add</a>(in <a href=#htmloptgroupelement>HTMLOptGroupElement</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);

Expand Down Expand Up @@ -48824,8 +48823,7 @@ <h4 id=the-select-element><span class=secno>4.10.9 </span>The <dfn><code>select<
end of the list.</p>
<p>This method will throw a <code><a href=#hierarchy_request_err>HIERARCHY_REQUEST_ERR</a></code>
exception if <var title="">element</var> is an ancestor of the
element into which it is to be inserted. 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 the method does nothing.</p>
element into which it is to be inserted.</p>
</dd>

<dt><var title="">select</var> . <code title=dom-select-selectedOptions><a href=#dom-select-selectedoptions>selectedOptions</a></code></dt>
Expand Down
24 changes: 11 additions & 13 deletions index
Expand Up @@ -8208,8 +8208,10 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
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-add title=dom-HTMLOptionsCollection-add>add</a>(in <a href=#htmloptionelement>HTMLOptionElement</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=#htmloptgroupelement>HTMLOptGroupElement</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=#htmloptionelement>HTMLOptionElement</a> element, in long before);
void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>(in <a href=#htmloptgroupelement>HTMLOptGroupElement</a> element, in long before);
void <a href=#dom-htmloptionscollection-remove title=dom-HTMLOptionsCollection-remove>remove</a>(in long index);
attribute long <a href=#dom-htmloptionscollection-selectedindex title=dom-HTMLOptionsCollection-selectedIndex>selectedIndex</a>;
};</pre>
Expand Down Expand Up @@ -8249,8 +8251,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
end of the list.</p>
<p>This method will throw a <code><a href=#hierarchy_request_err>HIERARCHY_REQUEST_ERR</a></code>
exception if <var title="">element</var> is an ancestor of the
element into which it is to be inserted. 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 the method does nothing.</p>
element into which it is to be inserted.</p>
</dd>

<dt><var title="">collection</var> . <code title=dom-HTMLOptionsCollection-selectedIndex><a href=#dom-htmloptionscollection-selectedindex>selectedIndex</a></code> [ = <var title="">value</var> ]</dt>
Expand Down Expand Up @@ -8343,11 +8344,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
</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>

<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
<ol><li><p>If <var title="">element</var> is an ancestor of the
<code><a href=#the-select-element>select</a></code> element on which the
<code><a href=#htmloptionscollection>HTMLOptionsCollection</a></code> is rooted, then throw a
<code><a href=#hierarchy_request_err>HIERARCHY_REQUEST_ERR</a></code> exception.</li>
Expand Down Expand Up @@ -48451,8 +48448,10 @@ You cannot submit this form when the field is incorrect.</samp></pre>
attribute unsigned long <a href=#dom-select-length title=dom-select-length>length</a>;
getter any <a href=#dom-select-item title=dom-select-item>item</a>(in unsigned long index);
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 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-add title=dom-select-add>add</a>(in <a href=#htmloptionelement>HTMLOptionElement</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=#htmloptgroupelement>HTMLOptGroupElement</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=#htmloptionelement>HTMLOptionElement</a> element, in long before);
void <a href=#dom-select-add title=dom-select-add>add</a>(in <a href=#htmloptgroupelement>HTMLOptGroupElement</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);

Expand Down Expand Up @@ -48691,8 +48690,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
end of the list.</p>
<p>This method will throw a <code><a href=#hierarchy_request_err>HIERARCHY_REQUEST_ERR</a></code>
exception if <var title="">element</var> is an ancestor of the
element into which it is to be inserted. 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 the method does nothing.</p>
element into which it is to be inserted.</p>
</dd>

<dt><var title="">select</var> . <code title=dom-select-selectedOptions><a href=#dom-select-selectedoptions>selectedOptions</a></code></dt>
Expand Down
24 changes: 10 additions & 14 deletions source
Expand Up @@ -8202,8 +8202,10 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
attribute unsigned long <span title="dom-HTMLOptionsCollection-length">length</span>; // overrides inherited length
caller getter object? <span title="dom-HTMLOptionsCollection-namedItem">namedItem</span>(in DOMString name); // overrides inherited namedItem()
<span title="dom-HTMLOptionsCollection-setter">setter creator</span> void (in unsigned long index, in <span>HTMLOptionElement</span> option);
void <span title="dom-HTMLOptionsCollection-add">add</span>(in <span>HTMLElement</span> element, in optional <span>HTMLElement</span>? before);
void <span title="dom-HTMLOptionsCollection-add">add</span>(in <span>HTMLElement</span> element, in long before);
void <span title="dom-HTMLOptionsCollection-add">add</span>(in <span>HTMLOptionElement</span> element, in optional <span>HTMLElement</span>? before);
void <span title="dom-HTMLOptionsCollection-add">add</span>(in <span>HTMLOptGroupElement</span> element, in optional <span>HTMLElement</span>? before);
void <span title="dom-HTMLOptionsCollection-add">add</span>(in <span>HTMLOptionElement</span> element, in long before);
void <span title="dom-HTMLOptionsCollection-add">add</span>(in <span>HTMLOptGroupElement</span> element, in long before);
void <span title="dom-HTMLOptionsCollection-remove">remove</span>(in long index);
attribute long <span title="dom-HTMLOptionsCollection-selectedIndex">selectedIndex</span>;
};</pre>
Expand Down Expand Up @@ -8245,9 +8247,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
end of the list.</p>
<p>This method will throw a <code>HIERARCHY_REQUEST_ERR</code>
exception if <var title="">element</var> is an ancestor of the
element into which it is to be inserted. If <var
title="">element</var> is not an <code>option</code> or
<code>optgroup</code> element, then the method does nothing.</p>
element into which it is to be inserted.</p>
</dd>

<dt><var title="">collection</var> . <code title="dom-HTMLOptionsCollection-selectedIndex">selectedIndex</code> [ = <var title="">value</var> ]</dt>
Expand Down Expand Up @@ -8368,10 +8368,6 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..

<ol>

<li><p>If <var title="">element</var> is not an <code>option</code>
or <code>optgroup</code> element, then return and abort these
steps.</li>

<li><p>If <var title="">element</var> is an ancestor of the
<code>select</code> element on which the
<code>HTMLOptionsCollection</code> is rooted, then throw a
Expand Down Expand Up @@ -54364,8 +54360,10 @@ You cannot submit this form when the field is incorrect.</samp></pre>
attribute unsigned long <span title="dom-select-length">length</span>;
getter any <span title="dom-select-item">item</span>(in unsigned long index);
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 optional <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-add">add</span>(in <span>HTMLOptionElement</span> element, in optional <span>HTMLElement</span>? before);
void <span title="dom-select-add">add</span>(in <span>HTMLOptGroupElement</span> element, in optional <span>HTMLElement</span>? before);
void <span title="dom-select-add">add</span>(in <span>HTMLOptionElement</span> element, in long before);
void <span title="dom-select-add">add</span>(in <span>HTMLOptGroupElement</span> element, in long before);
void <span title="dom-select-remove">remove</span>(in long index);
<span title="dom-HTMLOptionsCollection-setter">setter creator</span> void (in unsigned long index, in <span>HTMLOptionElement</span> option);

Expand Down Expand Up @@ -54649,9 +54647,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
end of the list.</p>
<p>This method will throw a <code>HIERARCHY_REQUEST_ERR</code>
exception if <var title="">element</var> is an ancestor of the
element into which it is to be inserted. If <var
title="">element</var> is not an <code>option</code> or
<code>optgroup</code> element, then the method does nothing.</p>
element into which it is to be inserted.</p>
</dd>

<dt><var title="">select</var> . <code title="dom-select-selectedOptions">selectedOptions</code></dt>
Expand Down

0 comments on commit 9e79e36

Please sign in to comment.