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

Unified Diff: Source/core/html/forms/MonthInputType.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/InputType.cpp ('k') | Source/core/html/forms/NumberInputType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/MonthInputType.cpp
diff --git a/Source/core/html/forms/MonthInputType.cpp b/Source/core/html/forms/MonthInputType.cpp
index 5aed90b5e70aa0cd3d20c786cc8d09ac314c63d5..00ac0cb96a5af2d66c1af29b761b4284d04894dc 100644
--- a/Source/core/html/forms/MonthInputType.cpp
+++ b/Source/core/html/forms/MonthInputType.cpp
@@ -108,11 +108,7 @@ StepRange MonthInputType::createStepRange(AnyStepHandling anyStepHandling) const
{
DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (monthDefaultStep, monthDefaultStepBase, monthStepScaleFactor, StepRange::ParsedStepValueShouldBeInteger));
- const Decimal stepBase = findStepBase(Decimal::fromDouble(monthDefaultStepBase));
- const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumMonth()));
- const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumMonth()));
- const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
- return StepRange(stepBase, minimum, maximum, step, stepDescription);
+ return InputType::createStepRange(anyStepHandling, Decimal::fromDouble(monthDefaultStepBase), Decimal::fromDouble(DateComponents::minimumMonth()), Decimal::fromDouble(DateComponents::maximumMonth()), stepDescription);
}
Decimal MonthInputType::parseToNumber(const String& src, const Decimal& defaultValue) const
« no previous file with comments | « Source/core/html/forms/InputType.cpp ('k') | Source/core/html/forms/NumberInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698