<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
On setting, if the <code title="dom-input-valueAsNumber"><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#dom-input-valueasnumber" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; "><font class="Apple-style-span" color="#000000" face="arial">valueAsNumber</font></a></code> attribute does not apply, as defined for the <code><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#the-input-element" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; "><font class="Apple-style-span" color="#000000" face="arial">input</font></a></code> element's <code title="attr-input-type"><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#attr-input-type" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; "><font class="Apple-style-span" color="#000000" face="arial">type</font></a></code> attribute's current state, then throw an<code><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#invalid_state_err" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; "><font class="Apple-style-span" color="#000000" face="arial">INVALID_STATE_ERR</font></a></code> exception. Otherwise, if the <code title="dom-input-valueAsDate"><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#dom-input-valueasdate" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; "><font class="Apple-style-span" color="#000000" face="arial">valueAsDate</font></a></code> attribute applies, run the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#concept-input-value-date-string" title="concept-input-value-date-string" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; "><font class="Apple-style-span" color="#000000">algorithm to convert a </font><code><font class="Apple-style-span" color="#000000" face="arial">Date</font></code><font class="Apple-style-span" color="#000000"> object to a string</font></a> defined for that state, passing it a <code><font class="Apple-style-span" face="arial">Date</font></code> object whose time value is the new value, and set the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; "><font class="Apple-style-span" color="#000000">value</font></a> of the element to resulting string. Otherwise, run the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#concept-input-value-number-string" title="concept-input-value-number-string" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; "><font class="Apple-style-span" color="#000000">algorithm to convert a number to a string</font></a>, as defined for that state, on the new value, and set the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; "><font class="Apple-style-span" color="#000000">value</font></a> of the element to resulting string.</blockquote>
</blockquote><div><span class="Apple-style-span" style="font-family: sans-serif, 'Droid Sans Fallback'; font-size: medium; line-height: 23px; "><br></span></div>It seems the current spec doesn't define behavior in a case of setting NaN or Infinitiy to HTMLInputElement::valueAsNumber.<div>
Because 'input.valueAsDate = null' makes the value empty, I think 'input.valueAsNumber = Number.NaN' also makes the value empty.<br><div><br></div><div>-- <br>TAMURA Kent <br>Software Engineer, Google <br>
<br><br><br>
</div></div>