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

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

Issue 83413002: Derive the step base for an input element as (now) specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Perform step base derivation via InputType::findStepBase() instead Created 7 years, 1 month 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 eabbbe9bae142ddff80eb2a1dc308f3b82bef93d..65ba6ea43779d26aa19026c89f694211d05cb3e0 100644
--- a/Source/core/html/forms/InputType.cpp
+++ b/Source/core/html/forms/InputType.cpp
@@ -985,4 +985,12 @@ void InputType::countUsageIfVisible(UseCounter::Feature feature) const
}
}
+Decimal InputType::findStepBase(const Decimal& defaultValue) const
yosin_UTC9 2013/11/27 01:28:05 The word "find" leads me the function has loop. Ho
+{
+ Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), Decimal::nan());
yosin_UTC9 2013/11/27 01:28:05 nit: const Decimal stepBase = ...;
+ if (!stepBase.isFinite())
+ stepBase = parseToNumber(element().fastGetAttribute(valueAttr), defaultValue);
yosin_UTC9 2013/11/27 01:28:05 nit: rather than copying, just |return parseToNumb
+ return stepBase;
+}
+
} // 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