Chromium Code Reviews| 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); |