[html5] r2889 - [] (0) Support select.add(e) and select.options.add(e) with no second argument. [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Mar 20 16:04:11 PDT 2009


Author: ianh
Date: 2009-03-20 16:04:10 -0700 (Fri, 20 Mar 2009)
New Revision: 2889

Modified:
   index
   source
Log:
[] (0) Support select.add(e) and select.options.add(e) with no second argument. (credit: cm)

Modified: index
===================================================================
--- index	2009-03-20 22:28:51 UTC (rev 2888)
+++ index	2009-03-20 23:04:10 UTC (rev 2889)
@@ -6063,7 +6063,7 @@
            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 @@
     <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 @@
            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 @@
     <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

Modified: source
===================================================================
--- source	2009-03-20 22:28:51 UTC (rev 2888)
+++ source	2009-03-20 23:04:10 UTC (rev 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




More information about the Commit-Watchers mailing list