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

Unified Diff: third_party/WebKit/Source/core/html/forms/InputType.cpp

Issue 2452743004: INPUT element: Fix integer overflow in input.stepDown(). (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/InputType.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/forms/InputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/InputType.cpp b/third_party/WebKit/Source/core/html/forms/InputType.cpp
index 48b12bd20519d52ea049b3720739ab7d795df06f..9e01ffd324155908fee3e7b570e24adc11d02d0b 100644
--- a/third_party/WebKit/Source/core/html/forms/InputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/InputType.cpp
@@ -672,7 +672,7 @@ ColorChooserClient* InputType::colorChooserClient() {
}
void InputType::applyStep(const Decimal& current,
- int count,
+ double count,
AnyStepHandling anyStepHandling,
TextFieldEventBehavior eventBehavior,
ExceptionState& exceptionState) {
@@ -725,7 +725,7 @@ void InputType::applyStep(const Decimal& current,
--count;
}
}
- newValue = newValue + stepRange.step() * count;
+ newValue = newValue + stepRange.step() * Decimal::fromDouble(count);
if (!equalIgnoringCase(stepString, "any"))
newValue = stepRange.alignValueForStep(current, newValue);
@@ -768,7 +768,7 @@ StepRange InputType::createStepRange(AnyStepHandling) const {
return StepRange();
}
-void InputType::stepUp(int n, ExceptionState& exceptionState) {
+void InputType::stepUp(double n, ExceptionState& exceptionState) {
if (!isSteppable()) {
exceptionState.throwDOMException(InvalidStateError,
"This form element is not steppable.");
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/InputType.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698