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

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

Issue 130213005: Add autofill preview support for <month> input fields (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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 | « LayoutTests/fast/forms/suggested-value-expected.txt ('k') | Source/core/html/forms/MonthInputType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
diff --git a/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
index 3fbe6236e7b4398297633f29013a9b138c182de6..dbf63d278550d8ca20a8d18e2a1fd1e9cd4fa217 100644
--- a/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
+++ b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
@@ -503,7 +503,11 @@ void BaseMultipleFieldsDateAndTimeInputType::updateView()
DateTimeEditElement::LayoutParameters layoutParameters(element().locale(), createStepRange(AnyIsDefaultStep));
DateComponents date;
- const bool hasValue = parseToDateComponents(element().value(), &date);
+ bool hasValue = false;
+ if (!element().suggestedValue().isNull())
+ hasValue = parseToDateComponents(element().suggestedValue(), &date);
+ else if (!element().formControlValueMatchesRenderer())
Ilya Sherman 2014/02/08 01:22:18 Why is it relevant whether the form control's valu
ziran.sun 2014/02/10 18:21:09 Done.
ziran.sun 2014/02/10 18:21:09 I noticed this check in updateView() in TextFieldI
+ hasValue = parseToDateComponents(element().value(), &date);
if (!hasValue)
setMillisecondToDateComponents(layoutParameters.stepRange.minimum().toDouble(), &date);
« no previous file with comments | « LayoutTests/fast/forms/suggested-value-expected.txt ('k') | Source/core/html/forms/MonthInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698