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

Unified Diff: Source/core/html/forms/TimeInputType.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/TimeInputType.h ('k') | Source/core/html/forms/URLInputType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/TimeInputType.cpp
diff --git a/Source/core/html/forms/TimeInputType.cpp b/Source/core/html/forms/TimeInputType.cpp
index 36d2b023754bf65bb1d24c61cfa9c10dea50a055..7e68ac402e054c2b15cc9ad9e52cdc80e73b8a22 100644
--- a/Source/core/html/forms/TimeInputType.cpp
+++ b/Source/core/html/forms/TimeInputType.cpp
@@ -51,12 +51,12 @@ static const int timeDefaultStep = 60;
static const int timeDefaultStepBase = 0;
static const int timeStepScaleFactor = 1000;
-TimeInputType::TimeInputType(HTMLInputElement* element)
+TimeInputType::TimeInputType(HTMLInputElement& element)
: BaseTimeInputType(element)
{
}
-PassRefPtr<InputType> TimeInputType::create(HTMLInputElement* element)
+PassRefPtr<InputType> TimeInputType::create(HTMLInputElement& element)
{
return adoptRef(new TimeInputType(element));
}
@@ -95,10 +95,10 @@ StepRange TimeInputType::createStepRange(AnyStepHandling anyStepHandling) const
{
DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (timeDefaultStep, timeDefaultStepBase, timeStepScaleFactor, StepRange::ScaledStepValueShouldBeInteger));
- const Decimal stepBase = parseToNumber(element()->fastGetAttribute(minAttr), 0);
- const Decimal minimum = parseToNumber(element()->fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumTime()));
- const Decimal maximum = parseToNumber(element()->fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumTime()));
- 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::minimumTime()));
+ const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumTime()));
+ const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
return StepRange(stepBase, minimum, maximum, step, stepDescription);
}
@@ -130,7 +130,7 @@ String TimeInputType::localizeValue(const String& proposedValue) const
Locale::FormatType formatType = shouldHaveSecondField(date) ? Locale::FormatTypeMedium : Locale::FormatTypeShort;
- String localized = element()->locale().formatDateTime(date, formatType);
+ String localized = element().locale().formatDateTime(date, formatType);
return localized.isEmpty() ? proposedValue : localized;
}
@@ -163,9 +163,9 @@ void TimeInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters&
layoutParameters.dateTimeFormat = layoutParameters.locale.shortTimeFormat();
layoutParameters.fallbackDateTimeFormat = "HH:mm";
}
- 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();
}
« no previous file with comments | « Source/core/html/forms/TimeInputType.h ('k') | Source/core/html/forms/URLInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698