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

Unified Diff: Source/core/html/forms/NumberInputType.cpp

Issue 108513007: Factor out common StepRange construction code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 | « Source/core/html/forms/MonthInputType.cpp ('k') | Source/core/html/forms/TimeInputType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/NumberInputType.cpp
diff --git a/Source/core/html/forms/NumberInputType.cpp b/Source/core/html/forms/NumberInputType.cpp
index 2466ec488bb250925ea9d9f9f16ad473730f4a0f..7928cf10e149cc194d5c714ee1b48d757f5bde4b 100644
--- a/Source/core/html/forms/NumberInputType.cpp
+++ b/Source/core/html/forms/NumberInputType.cpp
@@ -157,13 +157,10 @@ bool NumberInputType::typeMismatch() const
StepRange NumberInputType::createStepRange(AnyStepHandling anyStepHandling) const
{
DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (numberDefaultStep, numberDefaultStepBase, numberStepScaleFactor));
- const Decimal stepBase = findStepBase(numberDefaultStepBase);
+
// FIXME: We should use numeric_limits<double>::max for number input type.
const Decimal floatMax = Decimal::fromDouble(numeric_limits<float>::max());
- const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), -floatMax);
- const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), floatMax);
- const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
- return StepRange(stepBase, minimum, maximum, step, stepDescription);
+ return InputType::createStepRange(anyStepHandling, numberDefaultStepBase, -floatMax, floatMax, stepDescription);
}
bool NumberInputType::sizeShouldIncludeDecoration(int defaultSize, int& preferredSize) const
« no previous file with comments | « Source/core/html/forms/MonthInputType.cpp ('k') | Source/core/html/forms/TimeInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698