[html5] r7723 - [giow] (2) Define setting valueAsNumber to Infinity or NaN. Fixing https://www.w [...]
whatwg at whatwg.org
whatwg at whatwg.org
Wed Feb 13 12:21:21 PST 2013
Author: ianh
Date: 2013-02-13 12:21:19 -0800 (Wed, 13 Feb 2013)
New Revision: 7723
Modified:
complete.html
index
source
Log:
[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
Modified: complete.html
===================================================================
--- complete.html 2013-02-13 00:03:19 UTC (rev 7722)
+++ complete.html 2013-02-13 20:21:19 UTC (rev 7723)
@@ -49795,6 +49795,7 @@
<!--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 @@
<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 @@
</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 @@
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 @@
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>
Modified: index
===================================================================
--- index 2013-02-13 00:03:19 UTC (rev 7722)
+++ index 2013-02-13 20:21:19 UTC (rev 7723)
@@ -49795,6 +49795,7 @@
<!--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 @@
<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 @@
</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 @@
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 @@
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>
Modified: source
===================================================================
--- source 2013-02-13 00:03:19 UTC (rev 7722)
+++ source 2013-02-13 20:21:19 UTC (rev 7723)
@@ -57974,6 +57974,7 @@
<!--TOPIC:DOM APIs-->
+<!--CLEANUP-->
<h5>Common <code>input</code> element APIs</h5>
<dl class="domintro">
@@ -58041,7 +58042,8 @@
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 @@
</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 @@
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 @@
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 @@
<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>
More information about the Commit-Watchers
mailing list