Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[giow] (2) Define setting valueAsNumber to Infinity or NaN.

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...
commit b78c34e07569a0878b453064feaeaef62938cec7 1 parent e0d97cb
ianh authored
Showing with 30 additions and 18 deletions.
  1. +10 −6 complete.html
  2. +10 −6 index
  3. +10 −6 source
View
16 complete.html
@@ -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>
@@ -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>
@@ -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>
@@ -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
@@ -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>
View
16 index
@@ -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>
@@ -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>
@@ -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>
@@ -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
@@ -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>
View
16 source
@@ -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">
@@ -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>
@@ -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
@@ -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>
@@ -58237,11 +58240,12 @@ 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
@@ -58249,11 +58253,11 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<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>
Please sign in to comment.
Something went wrong with that request. Please try again.