[html5] r8497 - [giow] (1) Revert r8481 since I misunderstood how ToNumber works on objects. Fix [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Feb 21 09:23:56 PST 2014


Author: ianh
Date: 2014-02-21 09:23:55 -0800 (Fri, 21 Feb 2014)
New Revision: 8497

Modified:
   complete.html
   index
   source
Log:
[giow] (1) Revert r8481 since I misunderstood how ToNumber works on objects.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=24746
Affected topics: DOM APIs

Modified: complete.html
===================================================================
--- complete.html	2014-02-21 00:04:08 UTC (rev 8496)
+++ complete.html	2014-02-21 17:23:55 UTC (rev 8497)
@@ -7751,7 +7751,7 @@
   <a href=#dom-htmloptionscollection-nameditem title=dom-HTMLOptionsCollection-namedItem>legacycaller</a> <a href=#htmloptionelement>HTMLOptionElement</a>? (DOMString name);
   <a href=#dom-htmloptionscollection-setter title=dom-HTMLOptionsCollection-setter>setter creator</a> void (unsigned long index, <a href=#htmloptionelement>HTMLOptionElement</a>? option);
   void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>((<a href=#htmloptionelement>HTMLOptionElement</a> or <a href=#htmloptgroupelement>HTMLOptGroupElement</a>) element, optional (<a href=#htmlelement>HTMLElement</a> or long)? before = null);
-  void <a href=#dom-htmloptionscollection-remove title=dom-HTMLOptionsCollection-remove>remove</a>((long or object?) index);
+  void <a href=#dom-htmloptionscollection-remove title=dom-HTMLOptionsCollection-remove>remove</a>(long index);
            attribute long <a href=#dom-htmloptionscollection-selectedindex title=dom-HTMLOptionsCollection-selectedIndex>selectedIndex</a>;
 };</pre>
 
@@ -7875,20 +7875,21 @@
   <ol><li><p>If the number of nodes <a href=#represented-by-the-collection>represented by the collection</a> is zero, abort these
    steps.</li>
 
-   <li><p>If the argument <var title="">index</var> is not a number, set it to zero.</li>
-   <!-- objects get converted to zero: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2828 -->
+   <li><p>If <var title="">index</var> is not a number greater than or equal to 0 and less than the
+   number of nodes <a href=#represented-by-the-collection>represented by the collection</a>, abort these steps.</li>
+   <!-- note that Web IDL converts 'a', NaN, -0.5, 0.5, most objects, and null to 0, and numbers in
+   general truncate. so what we're checking against here in a way has very little to do with what's
+   going on in the JS -->
+   <!-- objects get converted by calling ToNumber which calls ToPrimitive which eventually calls valueOf:
+         http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2828
+         http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2833
+    -->
    <!-- same for select.remove(), which calls this algorithm also:
          http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2826
          http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2825
          http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2827
      -->
 
-   <li><p>If <var title="">index</var> is not a number greater than or equal to 0 and less than the
-   number of nodes <a href=#represented-by-the-collection>represented by the collection</a>, abort these steps.</li>
-   <!-- note that Web IDL converts 'a', NaN, -0.5, 0.5, and null to 0, and numbers in general
-   truncate. so what we're checking against here in a way has very little to do with what's going on
-   in the JS -->
-
    <li><p>Let <var title="">element</var> be the <var title="">index</var>th element in the
    collection.</li>
 
@@ -44695,7 +44696,7 @@
   <a href=#htmloptionelement>HTMLOptionElement</a>? <a href=#dom-select-nameditem title=dom-select-namedItem>namedItem</a>(DOMString name);
   void <a href=#dom-select-add title=dom-select-add>add</a>((<a href=#htmloptionelement>HTMLOptionElement</a> or <a href=#htmloptgroupelement>HTMLOptGroupElement</a>) element, optional (<a href=#htmlelement>HTMLElement</a> or long)? before = null);
   void <a href=#dom-select-remove title=dom-select-remove>remove</a>(); // ChildNode overload
-  void <a href=#dom-select-remove title=dom-select-remove>remove</a>((long or object?) index);
+  void <a href=#dom-select-remove title=dom-select-remove>remove</a>(long index);
   <a href=#dom-htmloptionscollection-setter title=dom-HTMLOptionsCollection-setter>setter creator</a> void (unsigned long index, <a href=#htmloptionelement>HTMLOptionElement</a>? option);
 
   readonly attribute <a href=#htmlcollection>HTMLCollection</a> <a href=#dom-select-selectedoptions title=dom-select-selectedOptions>selectedOptions</a>;

Modified: index
===================================================================
--- index	2014-02-21 00:04:08 UTC (rev 8496)
+++ index	2014-02-21 17:23:55 UTC (rev 8497)
@@ -7751,7 +7751,7 @@
   <a href=#dom-htmloptionscollection-nameditem title=dom-HTMLOptionsCollection-namedItem>legacycaller</a> <a href=#htmloptionelement>HTMLOptionElement</a>? (DOMString name);
   <a href=#dom-htmloptionscollection-setter title=dom-HTMLOptionsCollection-setter>setter creator</a> void (unsigned long index, <a href=#htmloptionelement>HTMLOptionElement</a>? option);
   void <a href=#dom-htmloptionscollection-add title=dom-HTMLOptionsCollection-add>add</a>((<a href=#htmloptionelement>HTMLOptionElement</a> or <a href=#htmloptgroupelement>HTMLOptGroupElement</a>) element, optional (<a href=#htmlelement>HTMLElement</a> or long)? before = null);
-  void <a href=#dom-htmloptionscollection-remove title=dom-HTMLOptionsCollection-remove>remove</a>((long or object?) index);
+  void <a href=#dom-htmloptionscollection-remove title=dom-HTMLOptionsCollection-remove>remove</a>(long index);
            attribute long <a href=#dom-htmloptionscollection-selectedindex title=dom-HTMLOptionsCollection-selectedIndex>selectedIndex</a>;
 };</pre>
 
@@ -7875,20 +7875,21 @@
   <ol><li><p>If the number of nodes <a href=#represented-by-the-collection>represented by the collection</a> is zero, abort these
    steps.</li>
 
-   <li><p>If the argument <var title="">index</var> is not a number, set it to zero.</li>
-   <!-- objects get converted to zero: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2828 -->
+   <li><p>If <var title="">index</var> is not a number greater than or equal to 0 and less than the
+   number of nodes <a href=#represented-by-the-collection>represented by the collection</a>, abort these steps.</li>
+   <!-- note that Web IDL converts 'a', NaN, -0.5, 0.5, most objects, and null to 0, and numbers in
+   general truncate. so what we're checking against here in a way has very little to do with what's
+   going on in the JS -->
+   <!-- objects get converted by calling ToNumber which calls ToPrimitive which eventually calls valueOf:
+         http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2828
+         http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2833
+    -->
    <!-- same for select.remove(), which calls this algorithm also:
          http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2826
          http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2825
          http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2827
      -->
 
-   <li><p>If <var title="">index</var> is not a number greater than or equal to 0 and less than the
-   number of nodes <a href=#represented-by-the-collection>represented by the collection</a>, abort these steps.</li>
-   <!-- note that Web IDL converts 'a', NaN, -0.5, 0.5, and null to 0, and numbers in general
-   truncate. so what we're checking against here in a way has very little to do with what's going on
-   in the JS -->
-
    <li><p>Let <var title="">element</var> be the <var title="">index</var>th element in the
    collection.</li>
 
@@ -44695,7 +44696,7 @@
   <a href=#htmloptionelement>HTMLOptionElement</a>? <a href=#dom-select-nameditem title=dom-select-namedItem>namedItem</a>(DOMString name);
   void <a href=#dom-select-add title=dom-select-add>add</a>((<a href=#htmloptionelement>HTMLOptionElement</a> or <a href=#htmloptgroupelement>HTMLOptGroupElement</a>) element, optional (<a href=#htmlelement>HTMLElement</a> or long)? before = null);
   void <a href=#dom-select-remove title=dom-select-remove>remove</a>(); // ChildNode overload
-  void <a href=#dom-select-remove title=dom-select-remove>remove</a>((long or object?) index);
+  void <a href=#dom-select-remove title=dom-select-remove>remove</a>(long index);
   <a href=#dom-htmloptionscollection-setter title=dom-HTMLOptionsCollection-setter>setter creator</a> void (unsigned long index, <a href=#htmloptionelement>HTMLOptionElement</a>? option);
 
   readonly attribute <a href=#htmlcollection>HTMLCollection</a> <a href=#dom-select-selectedoptions title=dom-select-selectedOptions>selectedOptions</a>;

Modified: source
===================================================================
--- source	2014-02-21 00:04:08 UTC (rev 8496)
+++ source	2014-02-21 17:23:55 UTC (rev 8497)
@@ -7249,7 +7249,7 @@
   <span data-x="dom-HTMLOptionsCollection-namedItem">legacycaller</span> <span>HTMLOptionElement</span>? (DOMString name);
   <span data-x="dom-HTMLOptionsCollection-setter">setter creator</span> void (unsigned long index, <span>HTMLOptionElement</span>? option);
   void <span data-x="dom-HTMLOptionsCollection-add">add</span>((<span>HTMLOptionElement</span> or <span>HTMLOptGroupElement</span>) element, optional (<span>HTMLElement</span> or long)? before = null);
-  void <span data-x="dom-HTMLOptionsCollection-remove">remove</span>((long or object?) index);
+  void <span data-x="dom-HTMLOptionsCollection-remove">remove</span>(long index);
            attribute long <span data-x="dom-HTMLOptionsCollection-selectedIndex">selectedIndex</span>;
 };</pre>
 
@@ -7406,20 +7406,21 @@
    <li><p>If the number of nodes <span>represented by the collection</span> is zero, abort these
    steps.</li>
 
-   <li><p>If the argument <var data-x="">index</var> is not a number, set it to zero.</p></li>
-   <!-- objects get converted to zero: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2828 -->
+   <li><p>If <var data-x="">index</var> is not a number greater than or equal to 0 and less than the
+   number of nodes <span>represented by the collection</span>, abort these steps.</p></li>
+   <!-- note that Web IDL converts 'a', NaN, -0.5, 0.5, most objects, and null to 0, and numbers in
+   general truncate. so what we're checking against here in a way has very little to do with what's
+   going on in the JS -->
+   <!-- objects get converted by calling ToNumber which calls ToPrimitive which eventually calls valueOf:
+         http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2828
+         http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2833
+    -->
    <!-- same for select.remove(), which calls this algorithm also:
          http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2826
          http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2825
          http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2827
      -->
 
-   <li><p>If <var data-x="">index</var> is not a number greater than or equal to 0 and less than the
-   number of nodes <span>represented by the collection</span>, abort these steps.</p></li>
-   <!-- note that Web IDL converts 'a', NaN, -0.5, 0.5, and null to 0, and numbers in general
-   truncate. so what we're checking against here in a way has very little to do with what's going on
-   in the JS -->
-
    <li><p>Let <var data-x="">element</var> be the <var data-x="">index</var>th element in the
    collection.</p></li>
 
@@ -48971,7 +48972,7 @@
   <span>HTMLOptionElement</span>? <span data-x="dom-select-namedItem">namedItem</span>(DOMString name);
   void <span data-x="dom-select-add">add</span>((<span>HTMLOptionElement</span> or <span>HTMLOptGroupElement</span>) element, optional (<span>HTMLElement</span> or long)? before = null);
   void <span data-x="dom-select-remove">remove</span>(); // ChildNode overload
-  void <span data-x="dom-select-remove">remove</span>((long or object?) index);
+  void <span data-x="dom-select-remove">remove</span>(long index);
   <span data-x="dom-HTMLOptionsCollection-setter">setter creator</span> void (unsigned long index, <span>HTMLOptionElement</span>? option);
 
   readonly attribute <span>HTMLCollection</span> <span data-x="dom-select-selectedOptions">selectedOptions</span>;




More information about the Commit-Watchers mailing list