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

Unified Diff: Source/core/html/forms/InputType.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.h ('k') | Source/core/html/forms/MonthInputType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/InputType.cpp
diff --git a/Source/core/html/forms/InputType.cpp b/Source/core/html/forms/InputType.cpp
index 65ba6ea43779d26aa19026c89f694211d05cb3e0..c443f6d202519dd9ee6a8fceb963f5964198c55b 100644
--- a/Source/core/html/forms/InputType.cpp
+++ b/Source/core/html/forms/InputType.cpp
@@ -993,4 +993,13 @@ Decimal InputType::findStepBase(const Decimal& defaultValue) const
return stepBase;
}
+StepRange InputType::createStepRange(AnyStepHandling anyStepHandling, const Decimal& stepBaseDefault, const Decimal& minimumDefault, const Decimal& maximumDefault, const StepRange::StepDescription& stepDescription) const
+{
+ const Decimal stepBase = findStepBase(stepBaseDefault);
+ const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), minimumDefault);
+ const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), maximumDefault);
+ const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
+ return StepRange(stepBase, minimum, maximum, step, stepDescription);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/html/forms/InputType.h ('k') | Source/core/html/forms/MonthInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698