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

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

Issue 152753002: Update input[type=range]'s step base handling to match spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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
Index: Source/core/html/forms/RangeInputType.cpp
diff --git a/Source/core/html/forms/RangeInputType.cpp b/Source/core/html/forms/RangeInputType.cpp
index 55066fcc48871707f8d234f19cac199c48c9d8ab..ff9fbad899899c13523e0fc9bfa0b02610357e43 100644
--- a/Source/core/html/forms/RangeInputType.cpp
+++ b/Source/core/html/forms/RangeInputType.cpp
@@ -124,17 +124,18 @@ StepRange RangeInputType::createStepRange(AnyStepHandling anyStepHandling) const
{
DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (rangeDefaultStep, rangeDefaultStepBase, rangeStepScaleFactor));
+ const Decimal stepBase = findStepBase(rangeDefaultStepBase);
const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), rangeDefaultMinimum);
const Decimal maximum = ensureMaximum(parseToNumber(element().fastGetAttribute(maxAttr), rangeDefaultMaximum), minimum, rangeDefaultMaximum);
const AtomicString& precisionValue = element().fastGetAttribute(precisionAttr);
sof 2014/02/03 18:36:09 I see there's a use counter against this attribute
tkent 2014/02/04 00:49:56 I checked it in the last week, and found the numbe
sof 2014/02/04 06:26:42 Thanks; how curious.
if (!precisionValue.isNull()) {
const Decimal step = equalIgnoringCase(precisionValue, "float") ? Decimal::nan() : 1;
- return StepRange(minimum, minimum, maximum, step, stepDescription);
+ return StepRange(stepBase, minimum, maximum, step, stepDescription);
}
const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
- return StepRange(minimum, minimum, maximum, step, stepDescription);
+ return StepRange(stepBase, minimum, maximum, step, stepDescription);
}
bool RangeInputType::isSteppable() const
« no previous file with comments | « LayoutTests/fast/forms/range/range-stepup-stepdown-expected.txt ('k') | Source/core/html/forms/StepRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698