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

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

Issue 27746003: Have InputType factories take an HTMLInputElement reference in parameter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 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 | « Source/core/html/forms/DateInputType.h ('k') | Source/core/html/forms/DateTimeLocalInputType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/DateInputType.cpp
diff --git a/Source/core/html/forms/DateInputType.cpp b/Source/core/html/forms/DateInputType.cpp
index 9ffc9434b19578e47644442ec3ea5a1963eb10ba..921cd4d92a1603ecbe75ea81760e12239e21da51 100644
--- a/Source/core/html/forms/DateInputType.cpp
+++ b/Source/core/html/forms/DateInputType.cpp
@@ -48,12 +48,12 @@ static const int dateDefaultStep = 1;
static const int dateDefaultStepBase = 0;
static const int dateStepScaleFactor = 86400000;
-inline DateInputType::DateInputType(HTMLInputElement* element)
+inline DateInputType::DateInputType(HTMLInputElement& element)
: BaseDateInputType(element)
{
}
-PassRefPtr<InputType> DateInputType::create(HTMLInputElement* element)
+PassRefPtr<InputType> DateInputType::create(HTMLInputElement& element)
{
return adoptRef(new DateInputType(element));
}
@@ -77,10 +77,10 @@ StepRange DateInputType::createStepRange(AnyStepHandling anyStepHandling) const
{
DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (dateDefaultStep, dateDefaultStepBase, dateStepScaleFactor, StepRange::ParsedStepValueShouldBeInteger));
- const Decimal stepBase = parseToNumber(element()->fastGetAttribute(minAttr), 0);
- const Decimal minimum = parseToNumber(element()->fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumDate()));
- const Decimal maximum = parseToNumber(element()->fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumDate()));
- const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element()->fastGetAttribute(stepAttr));
+ const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), 0);
+ const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumDate()));
+ const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumDate()));
+ const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
return StepRange(stepBase, minimum, maximum, step, stepDescription);
}
@@ -115,9 +115,9 @@ void DateInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters&
{
layoutParameters.dateTimeFormat = layoutParameters.locale.dateFormat();
layoutParameters.fallbackDateTimeFormat = "yyyy-MM-dd";
- if (!parseToDateComponents(element()->fastGetAttribute(minAttr), &layoutParameters.minimum))
+ if (!parseToDateComponents(element().fastGetAttribute(minAttr), &layoutParameters.minimum))
layoutParameters.minimum = DateComponents();
- if (!parseToDateComponents(element()->fastGetAttribute(maxAttr), &layoutParameters.maximum))
+ if (!parseToDateComponents(element().fastGetAttribute(maxAttr), &layoutParameters.maximum))
layoutParameters.maximum = DateComponents();
layoutParameters.placeholderForDay = locale().queryString(WebLocalizedString::PlaceholderForDayOfMonthField);
layoutParameters.placeholderForMonth = locale().queryString(WebLocalizedString::PlaceholderForMonthField);
« no previous file with comments | « Source/core/html/forms/DateInputType.h ('k') | Source/core/html/forms/DateTimeLocalInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698