Skip to content

Commit

Permalink
[giow] (1) Revert r8481 since I misunderstood how ToNumber works on o…
Browse files Browse the repository at this point in the history
…bjects.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=24746
Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@8497 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 21, 2014
1 parent cde09d9 commit 37f3221
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
21 changes: 11 additions & 10 deletions complete.html
Expand Up @@ -7751,7 +7751,7 @@ <h5 id=htmloptionscollection-0><span class=secno>2.7.2.3 </span>HTMLOptionsColle
<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>

Expand Down Expand Up @@ -7875,20 +7875,21 @@ <h5 id=htmloptionscollection-0><span class=secno>2.7.2.3 </span>HTMLOptionsColle
<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>

Expand Down Expand Up @@ -44695,7 +44696,7 @@ <h4 id=the-select-element><span class=secno>4.10.7 </span>The <dfn><code>select<
<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>;
Expand Down
21 changes: 11 additions & 10 deletions index
Expand Up @@ -7751,7 +7751,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
<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>

Expand Down Expand Up @@ -7875,20 +7875,21 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
<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>

Expand Down Expand Up @@ -44695,7 +44696,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<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>;
Expand Down
21 changes: 11 additions & 10 deletions source
Expand Up @@ -7249,7 +7249,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
<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>

Expand Down Expand Up @@ -7406,20 +7406,21 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
<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>

Expand Down Expand Up @@ -48971,7 +48972,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<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>;
Expand Down

0 comments on commit 37f3221

Please sign in to comment.