Skip to content
  • keishi@webkit.org's avatar
    Implement DataList UI for input type time on chromium · ca6178a6
    keishi@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=98240
    
    Reviewed by Kent Tamura.
    
    Source/WebCore:
    
    This adds datalist UI for input type time. We add the picker indicator to
    BaseMultipleFieldsDateAndTimeInputType. We enclose the dateTimeEdit element
    and picker indicator inside a new div element so we can position the picker
    indicator in the same place as input type=date.
    
    Tests: platform/chromium/fast/forms/time/time-suggestion-picker-appearance-rtl.html
           platform/chromium/fast/forms/time/time-suggestion-picker-appearance-with-scroll-bar.html
           platform/chromium/fast/forms/time/time-suggestion-picker-appearance.html
           platform/chromium/fast/forms/time/time-suggestion-picker-key-operations.html
           platform/chromium/fast/forms/time/time-suggestion-picker-mouse-operations.html
    
    * css/html.css:
    (input::-webkit-date-and-time-container):
    * html/BaseMultipleFieldsDateAndTimeInputType.cpp:
    (WebCore::BaseMultipleFieldsDateAndTimeInputType::BaseMultipleFieldsDateAndTimeInputType):
    (WebCore::BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree): Creates a picker indicator.
    (WebCore::BaseMultipleFieldsDateAndTimeInputType::handleKeydownEvent): Open the picker on Alt+Down.
    (WebCore):
    (WebCore::BaseMultipleFieldsDateAndTimeInputType::listAttributeTargetChanged): Updates picker visibility.
    (WebCore::BaseMultipleFieldsDateAndTimeInputType::updatePickerIndicatorVisibility): In the future, DateInputType can override
    this so the picker indicator is always visible.
    (WebCore::BaseMultipleFieldsDateAndTimeInputType::hidePickerIndicator):
    (WebCore::BaseMultipleFieldsDateAndTimeInputType::showPickerIndicator):
    * html/BaseMultipleFieldsDateAndTimeInputType.h:
    (WebCore):
    (BaseMultipleFieldsDateAndTimeInputType):
    * html/shadow/DateTimeFieldElement.cpp:
    (WebCore::DateTimeFieldElement::defaultKeyboardEventHandler): Ignore Alt+down because it should trigger the picker to open.
    * rendering/RenderThemeChromiumCommon.cpp:
    (WebCore::RenderThemeChromiumCommon::supportsDataListUI): Add time to the list.
    
    LayoutTests:
    
    * fast/forms/number/number-spinbutton-click-in-iframe.html:
    * fast/forms/resources/common-spinbutton-click-in-iframe.js:
    (getSpinButton): This broke because of the change to shadow DOM structure.
    * fast/forms/resources/common.js:
    (traverseNextNode):
    (getElementByPseudoId): This finds a descendant node with a matching pseudo id.
    * fast/forms/resources/suggestion-picker-common.js: Added.
    (highlightedEntry):
    (openPicker):
    (sendKey):
    * fast/forms/time-multiple-fields/time-multiple-fields-focus-style.html:
    * fast/forms/time-multiple-fields/time-multiple-fields-spinbutton-click-in-iframe.html:
    * platform/chromium-mac/platform/chromium/fast/forms/time/time-suggestion-picker-appearance-expected.png: Added.
    * platform/chromium-mac/platform/chromium/fast/forms/time/time-suggestion-picker-appearance-rtl-expected.png: Added.
    * platform/chromium-mac/platform/chromium/fast/forms/time/time-suggestion-picker-appearance-with-scroll-bar-expected.png: Added.
    * platform/chromium/TestExpectations:
    * platform/chromium/fast/forms/datalist/input-list-expected.txt:
    * platform/chromium/fast/forms/date/date-suggestion-picker-mouse-operations-expected.txt:
    * platform/chromium/fast/forms/date/date-suggestion-picker-mouse-operations.html:
    * platform/chromium/fast/forms/date/date-suggestion-picker-mouse-operations.html:
    * platform/chromium/fast/forms/time/time-suggestion-picker-appearance-expected.txt: Added.
    * platform/chromium/fast/forms/time/time-suggestion-picker-appearance-rtl-expected.txt: Added.
    * platform/chromium/fast/forms/time/time-suggestion-picker-appearance-rtl.html: Added.
    * platform/chromium/fast/forms/time/time-suggestion-picker-appearance-with-scroll-bar-expected.txt: Added.
    * platform/chromium/fast/forms/time/time-suggestion-picker-appearance-with-scroll-bar.html: Added.
    * platform/chromium/fast/forms/time/time-suggestion-picker-appearance.html: Added.
    * platform/chromium/fast/forms/time/time-suggestion-picker-key-operations-expected.txt: Added.
    * platform/chromium/fast/forms/time/time-suggestion-picker-key-operations.html: Added.
    * platform/chromium/fast/forms/time/time-suggestion-picker-mouse-operations-expected.txt: Added.
    * platform/chromium/fast/forms/time/time-suggestion-picker-mouse-operations.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ca6178a6