RESOLVED FIXED 113005
INPUT_MULTIPLE_FIELDS_UI: Incomplete datetime format should fallback to default
https://bugs.webkit.org/show_bug.cgi?id=113005
Summary INPUT_MULTIPLE_FIELDS_UI: Incomplete datetime format should fallback to default
Kunihiko Sakamoto
Reported 2013-03-21 22:48:58 PDT
Imported from https://code.google.com/p/chromium/issues/detail?id=182123 When system locale's datetime format is not complete (e.g. 12-hour without AM/PM field), user cannot enter valid value to datetime inputs. In such cases, fallback format should be used.
Attachments
Patch (33.40 KB, patch)
2013-03-21 23:33 PDT, Kunihiko Sakamoto
no flags
Patch 2 (33.44 KB, patch)
2013-03-22 00:28 PDT, Kunihiko Sakamoto
no flags
Patch 3, EWS build fix (33.49 KB, patch)
2013-03-22 00:33 PDT, Kunihiko Sakamoto
no flags
Patch 4 (33.52 KB, patch)
2013-03-22 02:19 PDT, Kunihiko Sakamoto
no flags
Kunihiko Sakamoto
Comment 1 2013-03-21 23:33:24 PDT
Kent Tamura
Comment 2 2013-03-22 00:13:58 PDT
Comment on attachment 194451 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=194451&action=review r- because of some style errors. > Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp:57 > +class FormatValidator : public DateTimeFormat::TokenHandler { This class belongs to the large WebCore namespace. We had better name more specific class name; e.g. WebCore::DateTimeFormatValidator. > Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp:73 > + bool validateFormat(const String& format, const BaseMultipleFieldsDateAndTimeInputType*); > +private: Need a blank line before a scope label. > Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp:123 > +bool FormatValidator::validateFormat(const String& format, const BaseMultipleFieldsDateAndTimeInputType* inputType) The second argument type should be "const BaseMultipleFieldDateAndTimeInputType&". > Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.h:54 > , protected ClearButtonElement::ClearButtonOwner { > +public: > + virtual bool isValidFormat(bool hasYear, bool hasMonth, bool hasWeek, bool hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) const = 0; > protected: Need a blank line before each of scope labels
Kunihiko Sakamoto
Comment 3 2013-03-22 00:28:51 PDT
Kunihiko Sakamoto
Comment 4 2013-03-22 00:33:58 PDT
Created attachment 194460 [details] Patch 3, EWS build fix
Kunihiko Sakamoto
Comment 5 2013-03-22 00:35:32 PDT
Comment on attachment 194451 [details] Patch Please take another look. View in context: https://bugs.webkit.org/attachment.cgi?id=194451&action=review >> Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp:57 >> +class FormatValidator : public DateTimeFormat::TokenHandler { > > This class belongs to the large WebCore namespace. We had better name more specific class name; e.g. WebCore::DateTimeFormatValidator. Done. >> Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp:73 >> +private: > > Need a blank line before a scope label. Done. >> Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp:123 >> +bool FormatValidator::validateFormat(const String& format, const BaseMultipleFieldsDateAndTimeInputType* inputType) > > The second argument type should be "const BaseMultipleFieldDateAndTimeInputType&". Done. >> Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.h:54 >> protected: > > Need a blank line before each of scope labels Done.
Kent Tamura
Comment 6 2013-03-22 01:10:00 PDT
Comment on attachment 194460 [details] Patch 3, EWS build fix View in context: https://bugs.webkit.org/attachment.cgi?id=194460&action=review FYI. I thought additional format parsing was not needed if we implement the check in DateTimeEditBuilder. However your design is simpler and we can avoid additional complexity of DateTimeEditBuilder. > Source/WebCore/ChangeLog:21 > + (FormatValidator): A helper class that parses datetime format and tests existence of fields. > + (WebCore::FormatValidator::FormatValidator): > + (WebCore::FormatValidator::visitField): > + (WebCore::FormatValidator::validateFormat): Parses datetime format and validates by calling BaseMultipleFieldsDateAndTimeInputType::isValidFormat. Need to update these lines
Kunihiko Sakamoto
Comment 7 2013-03-22 02:19:12 PDT
Kunihiko Sakamoto
Comment 8 2013-03-22 02:23:23 PDT
(In reply to comment #6) > (From update of attachment 194460 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=194460&action=review > > FYI. I thought additional format parsing was not needed if we implement the check in DateTimeEditBuilder. However your design is simpler and we can avoid additional complexity of DateTimeEditBuilder. Yeah first I attempted to check it in DateTimeEditBuilder, but then realized that InputType knows best whether format is valid or not. > > > Source/WebCore/ChangeLog:21 > > + (FormatValidator): A helper class that parses datetime format and tests existence of fields. > > + (WebCore::FormatValidator::FormatValidator): > > + (WebCore::FormatValidator::visitField): > > + (WebCore::FormatValidator::validateFormat): Parses datetime format and validates by calling BaseMultipleFieldsDateAndTimeInputType::isValidFormat. > > Need to update these lines Oops, done.
Kent Tamura
Comment 9 2013-03-22 02:39:24 PDT
Comment on attachment 194480 [details] Patch 4 ok
WebKit Review Bot
Comment 10 2013-03-22 03:06:42 PDT
Comment on attachment 194480 [details] Patch 4 Clearing flags on attachment: 194480 Committed r146584: <http://trac.webkit.org/changeset/146584>
WebKit Review Bot
Comment 11 2013-03-22 03:06:46 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.