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

Unified Diff: Source/core/html/forms/WeekInputType.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/WeekInputType.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/WeekInputType.cpp
diff --git a/Source/core/html/forms/WeekInputType.cpp b/Source/core/html/forms/WeekInputType.cpp
index 7a9f36c5d00e5b3a91d687083e5c123e4744c516..248b227656d42e1563d24c31491cf810db32f64c 100644
--- a/Source/core/html/forms/WeekInputType.cpp
+++ b/Source/core/html/forms/WeekInputType.cpp
@@ -48,7 +48,7 @@ static const int weekDefaultStepBase = -259200000; // The first day of 1970-W01.
static const int weekDefaultStep = 1;
static const int weekStepScaleFactor = 604800000;
-PassRefPtr<InputType> WeekInputType::create(HTMLInputElement* element)
+PassRefPtr<InputType> WeekInputType::create(HTMLInputElement& element)
{
return adoptRef(new WeekInputType(element));
}
@@ -72,10 +72,10 @@ StepRange WeekInputType::createStepRange(AnyStepHandling anyStepHandling) const
{
DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (weekDefaultStep, weekDefaultStepBase, weekStepScaleFactor, StepRange::ParsedStepValueShouldBeInteger));
- const Decimal stepBase = parseToNumber(element()->fastGetAttribute(minAttr), weekDefaultStepBase);
- const Decimal minimum = parseToNumber(element()->fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumWeek()));
- const Decimal maximum = parseToNumber(element()->fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumWeek()));
- const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element()->fastGetAttribute(stepAttr));
+ const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), weekDefaultStepBase);
+ const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumWeek()));
+ const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumWeek()));
+ const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
return StepRange(stepBase, minimum, maximum, step, stepDescription);
}
@@ -110,9 +110,9 @@ void WeekInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters&
{
layoutParameters.dateTimeFormat = locale().weekFormatInLDML();
layoutParameters.fallbackDateTimeFormat = "yyyy-'W'ww";
- 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.placeholderForYear = "----";
}
« no previous file with comments | « Source/core/html/forms/WeekInputType.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698