Skip to content

Commit

Permalink
[] (0) Support select.add(e) and select.options.add(e) with no second…
Browse files Browse the repository at this point in the history
… argument. (credit: cm)

git-svn-id: http://svn.whatwg.org/webapps@2889 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Mar 20, 2009
1 parent 384c970 commit a3c0087
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
25 changes: 13 additions & 12 deletions index
Expand Up @@ -6063,7 +6063,7 @@ 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, [Optional] 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>
Expand All @@ -6090,16 +6090,16 @@ interface <dfn id=htmloptionscollection-0>HTMLOptionsCollection</dfn> {
<p>Returns null if no element with that ID could be found.</p>
</dd>

<dt><var title="">collection</var> . <code title=dom-HTMLOptionsCollection-add><a href=#dom-htmloptionscollection-add>add</a></code>(<var title="">element</var>, <var title="">before</var>)</dt>
<dt><var title="">collection</var> . <code title=dom-HTMLOptionsCollection-add><a href=#dom-htmloptionscollection-add>add</a></code>(<var title="">element</var> [, <var title="">before</var> ] )</dt>
<dd>
<p>Inserts <var title="">element</var> before the node given by <var title="">before</var>.</p>
<p>The <var title="">before</var> argument can be a number, in
which case <var title="">element</var> is inserted before the item
with that number, or an element from the collection, in which case
<var title="">element</var> is inserted before that element.</p>
<p>If <var title="">before</var> is null or a number out of range,
then <var title="">element</var> will be added at the end of the
list.</p>
<p>If <var title="">before</var> is omitted, null, or a number out
of range, then <var title="">element</var> will be added at the
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
Expand Down Expand Up @@ -32410,7 +32410,7 @@ interface <dfn id=htmlselectelement>HTMLSelectElement</dfn> : <a href=#htmleleme
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, [Optional] 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 @@ -32577,16 +32577,17 @@ interface <dfn id=htmlselectelement>HTMLSelectElement</dfn> : <a href=#htmleleme
<p>Returns null if no element with that ID could be found.</p>
</dd>

<dt><var title="">select</var> . <code title=dom-select-add><a href=#dom-select-add>add</a></code>(<var title="">element</var>, <var title="">before</var>)</dt>
<dt><var title="">select</var> . <code title=dom-select-add><a href=#dom-select-add>add</a></code>(<var title="">element</var> [, <var title="">before</var> ])</dt>
<dd>
<p>Inserts <var title="">element</var> before the node given by <var title="">before</var>.</p>
<p>The <var title="">before</var> argument can be a number, in
which case <var title="">element</var> is inserted before the item
with that number, or an element from the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a>, in which case
<var title="">element</var> is inserted before that element.</p>
<p>If <var title="">before</var> is null or a number out of range,
then <var title="">element</var> will be added at the end of the
list.</p>
with that number, or an element from the <a href=#concept-select-option-list title=concept-select-option-list>list of options</a>, in
which case <var title="">element</var> is inserted before that
element.</p>
<p>If <var title="">before</var> is omitted, null, or a number out
of range, then <var title="">element</var> will be added at the
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
Expand Down
26 changes: 14 additions & 12 deletions source
Expand Up @@ -6013,7 +6013,7 @@ interface <dfn>HTMLOptionsCollection</dfn> {
attribute unsigned long <span title="dom-HTMLOptionsCollection-length">length</span>;
[IndexGetter] <span>HTMLOptionElement</span> <span title="dom-HTMLOptionsCollection-item">item</span>(in unsigned long index);
[NameGetter] Object <span title="dom-HTMLOptionsCollection-namedItem">namedItem</span>(in DOMString name);
void <span title="dom-HTMLOptionsCollection-add">add</span>(in <span>HTMLElement</span> element, in <span>HTMLElement</span> before);
void <span title="dom-HTMLOptionsCollection-add">add</span>(in <span>HTMLElement</span> element, [Optional] in <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-remove">remove</span>(in long index);
};</pre>
Expand Down Expand Up @@ -6042,16 +6042,16 @@ interface <dfn>HTMLOptionsCollection</dfn> {
<p>Returns null if no element with that ID could be found.</p>
</dd>

<dt><var title="">collection</var> . <code title="dom-HTMLOptionsCollection-add">add</code>(<var title="">element</var>, <var title="">before</var>)</dt>
<dt><var title="">collection</var> . <code title="dom-HTMLOptionsCollection-add">add</code>(<var title="">element</var> [, <var title="">before</var> ] )</dt>
<dd>
<p>Inserts <var title="">element</var> before the node given by <var title="">before</var>.</p>
<p>The <var title="">before</var> argument can be a number, in
which case <var title="">element</var> is inserted before the item
with that number, or an element from the collection, in which case
<var title="">element</var> is inserted before that element.</p>
<p>If <var title="">before</var> is null or a number out of range,
then <var title="">element</var> will be added at the end of the
list.</p>
<p>If <var title="">before</var> is omitted, null, or a number out
of range, then <var title="">element</var> will be added at the
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
Expand Down Expand Up @@ -36280,7 +36280,7 @@ interface <dfn>HTMLSelectElement</dfn> : <span>HTMLElement</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, [Optional] 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 @@ -36483,16 +36483,18 @@ interface <dfn>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
<p>Returns null if no element with that ID could be found.</p>
</dd>

<dt><var title="">select</var> . <code title="dom-select-add">add</code>(<var title="">element</var>, <var title="">before</var>)</dt>
<dt><var title="">select</var> . <code title="dom-select-add">add</code>(<var title="">element</var> [, <var title="">before</var> ])</dt>
<dd>
<p>Inserts <var title="">element</var> before the node given by <var title="">before</var>.</p>
<p>The <var title="">before</var> argument can be a number, in
which case <var title="">element</var> is inserted before the item
with that number, or an element from the <span title="concept-select-option-list">list of options</span>, in which case
<var title="">element</var> is inserted before that element.</p>
<p>If <var title="">before</var> is null or a number out of range,
then <var title="">element</var> will be added at the end of the
list.</p>
with that number, or an element from the <span
title="concept-select-option-list">list of options</span>, in
which case <var title="">element</var> is inserted before that
element.</p>
<p>If <var title="">before</var> is omitted, null, or a number out
of range, then <var title="">element</var> will be added at the
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
Expand Down

0 comments on commit a3c0087

Please sign in to comment.