Skip to content
Browse files

[] (0) Support select.add(e) and select.options.add(e) with no second…

… argument. (credit: cm)

git-svn-id: http://svn.whatwg.org/webapps@2889 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent 384c970 commit a3c00873b90785167b133df5a757db5f906fe396 @Hixie Hixie committed
Showing with 27 additions and 24 deletions.
  1. +13 −12 index
  2. +14 −12 source
View
25 index
@@ -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>
@@ -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
@@ -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);
@@ -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
View
26 source
@@ -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>
@@ -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
@@ -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);
@@ -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

0 comments on commit a3c0087

Please sign in to comment.
Something went wrong with that request. Please try again.