Short URL: http://html5.org/r/2889
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 2889 | Support select.add(e) and select.options.add(e) with no second argument. (credit: cm) | 2009-03-20 23:04 |
Index: source
===================================================================
--- source (revision 2888)
+++ source (revision 2889)
@@ -6013,7 +6013,7 @@
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 @@
<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 @@
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 @@
<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