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

Unified Diff: Source/core/html/forms/InputType.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/forms/InputType.cpp
diff --git a/Source/core/html/forms/InputType.cpp b/Source/core/html/forms/InputType.cpp
index 0b435546b2b7df229b94fa85e38ba3af0ec17112..14a949057701edf0e7b6e72f2b5aff23e4f33190 100644
--- a/Source/core/html/forms/InputType.cpp
+++ b/Source/core/html/forms/InputType.cpp
@@ -222,12 +222,12 @@ double InputType::valueAsDouble() const
void InputType::setValueAsDouble(double doubleValue, TextFieldEventBehavior eventBehavior, ExceptionState& exceptionState) const
{
- setValueAsDecimal(Decimal::fromDouble(doubleValue), eventBehavior, exceptionState);
+ exceptionState.throwDOMException(InvalidStateError, "This input element does not support Number values.");
}
-void InputType::setValueAsDecimal(const Decimal&, TextFieldEventBehavior, ExceptionState& exceptionState) const
+void InputType::setValueAsDecimal(const Decimal& newValue, TextFieldEventBehavior eventBehavior, ExceptionState&) const
{
- exceptionState.throwDOMException(InvalidStateError, "This input element does not support Decimal values.");
+ element().setValue(serialize(newValue), eventBehavior);
}
bool InputType::supportsValidation() const

Powered by Google App Engine
This is Rietveld 408576698