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

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

Issue 2048943002: Fix an assertion failure in InputType::applyStep() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | third_party/WebKit/Source/core/html/forms/StepRange.h » ('j') | 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 5e88d20f06163d16beb9455f7b7881d317176e4a..4144964b1bafe54d316c233652aa570ba3f01c52 100644
--- a/third_party/WebKit/Source/core/html/forms/InputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/InputType.cpp
@@ -747,13 +747,12 @@ void InputType::applyStep(const Decimal& current, int count, AnyStepHandling any
// greater than or equal to the element's minimum and less than or equal to
// the element's maximum that, when subtracted from the step base, is an
// integral multiple of the allowed value step, then abort these steps.
- const Decimal base = stepRange.stepBase();
- const Decimal step = stepRange.step();
- const Decimal alignedMaximum = base + ((stepRange.maximum() - base) / step).floor() * step;
- ASSERT(alignedMaximum <= stepRange.maximum());
- if (alignedMaximum < stepRange.minimum())
+ Decimal alignedMaximum = stepRange.stepSnappedMaximum();
+ if (!alignedMaximum.isFinite())
return;
+ Decimal base = stepRange.stepBase();
+ Decimal step = stepRange.step();
EventQueueScope scope;
Decimal newValue = current;
const AtomicString& stepString = element().fastGetAttribute(stepAttr);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/StepRange.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698