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

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

Issue 2742243002: input[type=range]: if min > max use min as default value. (Closed)
Patch Set: Created 3 years, 9 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 | « third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/range-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
index 7d9016858096c90d26ba1bff7644678a89680f50..d67be4f11948261b48c0ffedaea89485069d91f8 100644
--- a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
@@ -65,10 +65,8 @@ static const int rangeDefaultStepBase = 0;
static const int rangeStepScaleFactor = 1;
static Decimal ensureMaximum(const Decimal& proposedValue,
- const Decimal& minimum,
- const Decimal& fallbackValue) {
- return proposedValue >= minimum ? proposedValue
- : std::max(minimum, fallbackValue);
+ const Decimal& minimum) {
+ return proposedValue >= minimum ? proposedValue : minimum;
}
InputType* RangeInputType::create(HTMLInputElement& element) {
@@ -134,7 +132,7 @@ StepRange RangeInputType::createStepRange(
parseToNumber(element().fastGetAttribute(minAttr), rangeDefaultMinimum);
const Decimal maximum = ensureMaximum(
parseToNumber(element().fastGetAttribute(maxAttr), rangeDefaultMaximum),
- minimum, rangeDefaultMaximum);
+ minimum);
const Decimal step = StepRange::parseStep(
anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/range-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698