Skip to content
  • commit-queue@webkit.org's avatar
    INPUT_MULTIPLE_FIELDS_UI: Incomplete datetime format should fallback to default · 8d06d34e
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=113005
    
    Patch by Kunihiko Sakamoto <ksakamoto@chromium.org> on 2013-03-22
    Reviewed by Kent Tamura.
    
    Source/WebCore:
    
    Use fallback format when datetime format from locale is not complete.
    
    Tests: fast/forms/date-multiple-fields/date-multiple-fields-fallback-format.html
           fast/forms/datetime-multiple-fields/datetime-multiple-fields-fallback-format.html
           fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-fallback-format.html
           fast/forms/month-multiple-fields/month-multiple-fields-fallback-format.html
           fast/forms/time-multiple-fields/time-multiple-fields-fallback-format.html
           fast/forms/week-multiple-fields/week-multiple-fields-fallback-format.html
    
    * html/BaseMultipleFieldsDateAndTimeInputType.cpp:
    (DateTimeFormatValidator): A helper class that parses datetime format and tests existence of fields.
    (WebCore::DateTimeFormatValidator::DateTimeFormatValidator):
    (WebCore::DateTimeFormatValidator::visitField):
    (WebCore::DateTimeFormatValidator::validateFormat): Parses datetime format and validates by calling BaseMultipleFieldsDateAndTimeInputType::isValidFormat.
    (WebCore::BaseMultipleFieldsDateAndTimeInputType::updateInnerTextValue): Checks if dateTimeFormat is valid, and uses fallback format if not.
    * html/BaseMultipleFieldsDateAndTimeInputType.h:
    (BaseMultipleFieldsDateAndTimeInputType): Declare isValidFormat.
    * html/DateInputType.cpp:
    (WebCore::DateInputType::isValidFormat): Added.
    * html/DateInputType.h:
    (DateInputType):
    * html/DateTimeInputType.cpp:
    (WebCore::DateTimeInputType::isValidFormat): Added.
    * html/DateTimeInputType.h:
    (DateTimeInputType):
    * html/DateTimeLocalInputType.cpp:
    (WebCore::DateTimeLocalInputType::isValidFormat): Added.
    * html/DateTimeLocalInputType.h:
    (DateTimeLocalInputType):
    * html/MonthInputType.cpp:
    (WebCore::MonthInputType::isValidFormat): Added.
    * html/MonthInputType.h:
    (MonthInputType):
    * html/TimeInputType.cpp:
    (WebCore::TimeInputType::isValidFormat): Added.
    * html/TimeInputType.h:
    (TimeInputType):
    * html/WeekInputType.cpp:
    (WebCore::WeekInputType::isValidFormat): Added.
    * html/WeekInputType.h:
    (WeekInputType):
    
    LayoutTests:
    
    * fast/forms/date-multiple-fields/date-multiple-fields-fallback-format-expected.txt: Added.
    * fast/forms/date-multiple-fields/date-multiple-fields-fallback-format.html: Added.
    * fast/forms/datetime-multiple-fields/datetime-multiple-fields-fallback-format-expected.txt: Added.
    * fast/forms/datetime-multiple-fields/datetime-multiple-fields-fallback-format.html: Added.
    * fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-fallback-format-expected.txt: Added.
    * fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-fallback-format.html: Added.
    * fast/forms/month-multiple-fields/month-multiple-fields-fallback-format-expected.txt: Added.
    * fast/forms/month-multiple-fields/month-multiple-fields-fallback-format.html: Added.
    * fast/forms/time-multiple-fields/time-multiple-fields-fallback-format-expected.txt: Added.
    * fast/forms/time-multiple-fields/time-multiple-fields-fallback-format.html: Added.
    * fast/forms/week-multiple-fields/week-multiple-fields-fallback-format-expected.txt: Added.
    * fast/forms/week-multiple-fields/week-multiple-fields-fallback-format.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8d06d34e