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

Unified Diff: Source/core/html/forms/BaseDateAndTimeInputType.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
Index: Source/core/html/forms/BaseDateAndTimeInputType.cpp
diff --git a/Source/core/html/forms/BaseDateAndTimeInputType.cpp b/Source/core/html/forms/BaseDateAndTimeInputType.cpp
index 5c10876b3a84fc13e1cf05d0cf11157b300dcc5e..05f27a322c45cfbbd306c4417aba3d6e40d12e41 100644
--- a/Source/core/html/forms/BaseDateAndTimeInputType.cpp
+++ b/Source/core/html/forms/BaseDateAndTimeInputType.cpp
@@ -55,18 +55,18 @@ double BaseDateAndTimeInputType::valueAsDate() const
void BaseDateAndTimeInputType::setValueAsDate(double value, ExceptionState&) const
{
- element()->setValue(serializeWithMilliseconds(value));
+ element().setValue(serializeWithMilliseconds(value));
}
double BaseDateAndTimeInputType::valueAsDouble() const
{
- const Decimal value = parseToNumber(element()->value(), Decimal::nan());
+ const Decimal value = parseToNumber(element().value(), Decimal::nan());
return value.isFinite() ? value.toDouble() : DateComponents::invalidMilliseconds();
}
void BaseDateAndTimeInputType::setValueAsDecimal(const Decimal& newValue, TextFieldEventBehavior eventBehavior, ExceptionState&) const
{
- element()->setValue(serialize(newValue), eventBehavior);
+ element().setValue(serialize(newValue), eventBehavior);
}
bool BaseDateAndTimeInputType::typeMismatchFor(const String& value) const
@@ -76,7 +76,7 @@ bool BaseDateAndTimeInputType::typeMismatchFor(const String& value) const
bool BaseDateAndTimeInputType::typeMismatch() const
{
- return typeMismatchFor(element()->value());
+ return typeMismatchFor(element().value());
}
String BaseDateAndTimeInputType::rangeOverflowText(const Decimal& maximum) const
@@ -136,7 +136,7 @@ String BaseDateAndTimeInputType::serialize(const Decimal& value) const
String BaseDateAndTimeInputType::serializeWithComponents(const DateComponents& date) const
{
Decimal step;
- if (!element()->getAllowedValueStep(&step))
+ if (!element().getAllowedValueStep(&step))
return date.toString();
if (step.remainder(msecPerMinute).isZero())
return date.toString(DateComponents::None);
@@ -156,13 +156,13 @@ String BaseDateAndTimeInputType::localizeValue(const String& proposedValue) cons
if (!parseToDateComponents(proposedValue, &date))
return proposedValue;
- String localized = element()->locale().formatDateTime(date);
+ String localized = element().locale().formatDateTime(date);
return localized.isEmpty() ? proposedValue : localized;
}
String BaseDateAndTimeInputType::visibleValue() const
{
- return localizeValue(element()->value());
+ return localizeValue(element().value());
}
String BaseDateAndTimeInputType::sanitizeValue(const String& proposedValue) const
@@ -182,7 +182,7 @@ bool BaseDateAndTimeInputType::shouldRespectListAttribute()
bool BaseDateAndTimeInputType::valueMissing(const String& value) const
{
- return element()->isRequired() && value.isEmpty();
+ return element().isRequired() && value.isEmpty();
}
bool BaseDateAndTimeInputType::shouldShowFocusRingOnMouseFocus() const
« no previous file with comments | « Source/core/html/forms/BaseDateAndTimeInputType.h ('k') | Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698