Skip to content

Commit

Permalink
[giow] (2) Define setting valueAsNumber to Infinity or NaN.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=20496
Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@7723 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 13, 2013
1 parent a1ff0f3 commit 8920d4b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
16 changes: 10 additions & 6 deletions complete.html
Expand Up @@ -49795,6 +49795,7 @@ <h6 id=the-placeholder-attribute><span class=secno>4.10.7.3.10 </span>The <code


<!--TOPIC:DOM APIs-->
<!--CLEANUP-->
<h5 id=common-input-element-apis><span class=secno>4.10.7.4 </span>Common <code><a href=#the-input-element>input</a></code> element APIs</h5>

<dl class=domintro><dt><var title="">input</var> . <code title=dom-input-value><a href=#dom-input-value>value</a></code> [ = <var title="">value</var> ]</dt>
Expand Down Expand Up @@ -49856,7 +49857,8 @@ <h5 id=common-input-element-apis><span class=secno>4.10.7.4 </span>Common <code>
<p>Returns a number representing the form control's <a href=#concept-fe-value title=concept-fe-value>value</a>, if applicable; otherwise,
returns NaN.</p>

<p>Can be set, to change the value.</p>
<p>Can be set, to change the value. Setting this to NaN will set the underlying value to the
empty string.</p>

<p>Throws an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception if the
control is neither date- or time-based nor numeric.</p>
Expand Down Expand Up @@ -49888,6 +49890,7 @@ <h5 id=common-input-element-apis><span class=secno>4.10.7.4 </span>Common <code>
</dd>

</dl><div class=impl>
<!--CLEANUP-->

<p>The <dfn id=dom-input-value title=dom-input-value><code>value</code></dfn> IDL
attribute allows scripts to manipulate the <a href=#concept-fe-value title=concept-fe-value>value</a> of an <code><a href=#the-input-element>input</a></code>
Expand Down Expand Up @@ -49984,7 +49987,7 @@ <h5 id=common-input-element-apis><span class=secno>4.10.7.4 </span>Common <code>
time value, then set the <a href=#concept-fe-value title=concept-fe-value>value</a>
of the element to the empty string; otherwise, run the <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, as defined for that
state, on the new value, and set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to resulting
state, on the new value, and set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to the resulting
string.</p>

<hr><p>The <dfn id=dom-input-valueasnumber title=dom-input-valueAsNumber><code>valueAsNumber</code></dfn> IDL
Expand All @@ -50005,18 +50008,19 @@ <h5 id=common-input-element-apis><span class=secno>4.10.7.4 </span>Common <code>
returned a number, then return it, otherwise, return a Not-a-Number
(NaN) value.</p>

<p>On setting, if the <code title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> attribute does
<p>On setting, if the new value is infinite, then throw a <code>TypeError</code> exception. Otherwise, if the <code title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> attribute does
not apply, as defined for the <code><a href=#the-input-element>input</a></code> element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute's current state, then
throw an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception. Otherwise, if
throw an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception. Otherwise, if the new value is a Not-a-Number (NaN) value,
then set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to the empty string. Otherwise, if
the <code title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAs<em>Date</em></a></code>
attribute applies, run the <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a> defined for that state,
passing it a <code>Date</code> object whose <i>time value</i> is the
new value, and set the <a href=#concept-fe-value title=concept-fe-value>value</a>
of the element to resulting string. Otherwise, run the <a href=#concept-input-value-number-string title=concept-input-value-number-string>algorithm to convert a
of the element to the resulting string. Otherwise, run the <a href=#concept-input-value-number-string title=concept-input-value-number-string>algorithm to convert a
number to a string</a>, as defined for that state, on the new
value, and set the <a href=#concept-fe-value title=concept-fe-value>value</a> of
the element to resulting string.</p>
the element to the resulting string.</p>

<hr><p>The <dfn id=dom-input-stepdown title=dom-input-stepDown><code>stepDown(<var title="">n</var>)</code></dfn> and <dfn id=dom-input-stepup title=dom-input-stepUp><code>stepUp(<var title="">n</var>)</code></dfn> methods, when invoked, must run the
following algorithm:</p>
Expand Down
16 changes: 10 additions & 6 deletions index
Expand Up @@ -49795,6 +49795,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>


<!--TOPIC:DOM APIs-->
<!--CLEANUP-->
<h5 id=common-input-element-apis><span class=secno>4.10.7.4 </span>Common <code><a href=#the-input-element>input</a></code> element APIs</h5>

<dl class=domintro><dt><var title="">input</var> . <code title=dom-input-value><a href=#dom-input-value>value</a></code> [ = <var title="">value</var> ]</dt>
Expand Down Expand Up @@ -49856,7 +49857,8 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<p>Returns a number representing the form control's <a href=#concept-fe-value title=concept-fe-value>value</a>, if applicable; otherwise,
returns NaN.</p>

<p>Can be set, to change the value.</p>
<p>Can be set, to change the value. Setting this to NaN will set the underlying value to the
empty string.</p>

<p>Throws an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception if the
control is neither date- or time-based nor numeric.</p>
Expand Down Expand Up @@ -49888,6 +49890,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
</dd>

</dl><div class=impl>
<!--CLEANUP-->

<p>The <dfn id=dom-input-value title=dom-input-value><code>value</code></dfn> IDL
attribute allows scripts to manipulate the <a href=#concept-fe-value title=concept-fe-value>value</a> of an <code><a href=#the-input-element>input</a></code>
Expand Down Expand Up @@ -49984,7 +49987,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
time value, then set the <a href=#concept-fe-value title=concept-fe-value>value</a>
of the element to the empty string; otherwise, run the <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a>, as defined for that
state, on the new value, and set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to resulting
state, on the new value, and set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to the resulting
string.</p>

<hr><p>The <dfn id=dom-input-valueasnumber title=dom-input-valueAsNumber><code>valueAsNumber</code></dfn> IDL
Expand All @@ -50005,18 +50008,19 @@ You cannot submit this form when the field is incorrect.</samp></pre>
returned a number, then return it, otherwise, return a Not-a-Number
(NaN) value.</p>

<p>On setting, if the <code title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> attribute does
<p>On setting, if the new value is infinite, then throw a <code>TypeError</code> exception. Otherwise, if the <code title=dom-input-valueAsNumber><a href=#dom-input-valueasnumber>valueAsNumber</a></code> attribute does
not apply, as defined for the <code><a href=#the-input-element>input</a></code> element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute's current state, then
throw an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception. Otherwise, if
throw an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception. Otherwise, if the new value is a Not-a-Number (NaN) value,
then set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to the empty string. Otherwise, if
the <code title=dom-input-valueAsDate><a href=#dom-input-valueasdate>valueAs<em>Date</em></a></code>
attribute applies, run the <a href=#concept-input-value-date-string title=concept-input-value-date-string>algorithm to convert a
<code>Date</code> object to a string</a> defined for that state,
passing it a <code>Date</code> object whose <i>time value</i> is the
new value, and set the <a href=#concept-fe-value title=concept-fe-value>value</a>
of the element to resulting string. Otherwise, run the <a href=#concept-input-value-number-string title=concept-input-value-number-string>algorithm to convert a
of the element to the resulting string. Otherwise, run the <a href=#concept-input-value-number-string title=concept-input-value-number-string>algorithm to convert a
number to a string</a>, as defined for that state, on the new
value, and set the <a href=#concept-fe-value title=concept-fe-value>value</a> of
the element to resulting string.</p>
the element to the resulting string.</p>

<hr><p>The <dfn id=dom-input-stepdown title=dom-input-stepDown><code>stepDown(<var title="">n</var>)</code></dfn> and <dfn id=dom-input-stepup title=dom-input-stepUp><code>stepUp(<var title="">n</var>)</code></dfn> methods, when invoked, must run the
following algorithm:</p>
Expand Down
16 changes: 10 additions & 6 deletions source
Expand Up @@ -57974,6 +57974,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>


<!--TOPIC:DOM APIs-->
<!--CLEANUP-->
<h5>Common <code>input</code> element APIs</h5>

<dl class="domintro">
Expand Down Expand Up @@ -58041,7 +58042,8 @@ You cannot submit this form when the field is incorrect.</samp></pre>
title="concept-fe-value">value</span>, if applicable; otherwise,
returns NaN.</p>

<p>Can be set, to change the value.</p>
<p>Can be set, to change the value. Setting this to NaN will set the underlying value to the
empty string.</p>

<p>Throws an <code>InvalidStateError</code> exception if the
control is neither date- or time-based nor numeric.</p>
Expand Down Expand Up @@ -58077,6 +58079,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
</dl>

<div class="impl">
<!--CLEANUP-->

<p>The <dfn title="dom-input-value"><code>value</code></dfn> IDL
attribute allows scripts to manipulate the <span
Expand Down Expand Up @@ -58208,7 +58211,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
title="concept-input-value-date-string">algorithm to convert a
<code>Date</code> object to a string</span>, as defined for that
state, on the new value, and set the <span
title="concept-fe-value">value</span> of the element to resulting
title="concept-fe-value">value</span> of the element to the resulting
string.</p>

<hr>
Expand Down Expand Up @@ -58237,23 +58240,24 @@ You cannot submit this form when the field is incorrect.</samp></pre>
returned a number, then return it, otherwise, return a Not-a-Number
(NaN) value.</p>

<p>On setting, if the <code
<p>On setting, if the new value is infinite, then throw a <code>TypeError</code> exception. Otherwise, if the <code
title="dom-input-valueAsNumber">valueAsNumber</code> attribute does
not apply, as defined for the <code>input</code> element's <code
title="attr-input-type">type</code> attribute's current state, then
throw an <code>InvalidStateError</code> exception. Otherwise, if
throw an <code>InvalidStateError</code> exception. Otherwise, if the new value is a Not-a-Number (NaN) value,
then set the <span title="concept-fe-value">value</span> of the element to the empty string. Otherwise, if
the <code
title="dom-input-valueAsDate">valueAs<em>Date</em></code>
attribute applies, run the <span
title="concept-input-value-date-string">algorithm to convert a
<code>Date</code> object to a string</span> defined for that state,
passing it a <code>Date</code> object whose <i>time value</i> is the
new value, and set the <span title="concept-fe-value">value</span>
of the element to resulting string. Otherwise, run the <span
of the element to the resulting string. Otherwise, run the <span
title="concept-input-value-number-string">algorithm to convert a
number to a string</span>, as defined for that state, on the new
value, and set the <span title="concept-fe-value">value</span> of
the element to resulting string.</p>
the element to the resulting string.</p>

<hr>

Expand Down

0 comments on commit 8920d4b

Please sign in to comment.