Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1075)

Unified Diff: Source/core/html/HTMLInputElement.cpp

Issue 149413004: HTMLInputElement.valueAsNumber compliance (NaN handling.) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLInputElement.cpp
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index 80cda11bbe2e11fa7bf55f2af3aa5c9d85a2d3da..6e6a03f6b0d66043b0cd4a0a2032c16aff471547 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -1055,8 +1055,8 @@ double HTMLInputElement::valueAsNumber() const
void HTMLInputElement::setValueAsNumber(double newValue, ExceptionState& exceptionState, TextFieldEventBehavior eventBehavior)
{
- if (!std::isfinite(newValue)) {
- exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(newValue));
+ if (std::isinf(newValue)) {
+ exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(newValue));
return;
}
m_inputType->setValueAsDouble(newValue, eventBehavior, exceptionState);

Powered by Google App Engine
This is Rietveld 408576698