BaseChooserOnlyDateAndTimeInputType should have BaseClickableWithKeyInputType behavior
authorKent Tamura <tkent@chromium.org>
Sun, 4 Nov 2012 23:16:13 +0000 (23:16 +0000)
committerKent Tamura <tkent@chromium.org>
Sun, 4 Nov 2012 23:16:13 +0000 (23:16 +0000)
commit9944843dce1548b5304f0a88e2b297d5e9375dc5
tree0d7d5d1f0a1de0e81cc6c86c27f84c3ae78e7660
parentac0bf96848e46cfb709e693a93e6b8169bea2234
BaseChooserOnlyDateAndTimeInputType should have BaseClickableWithKeyInputType behavior
https://bugs.webkit.org/show_bug.cgi?id=101039

Reviewed by Hajime Morita.

Add BaseClickableWithKeyInputType behavior to
BaseChooserOnlyDateAndTimeInputType. It means date/time input types
without ENABLE_INPUT_MULTIPLE_FIELDS_UI receive DOMActivate events by
pressing space or enter key. They're going to open a date/time chooser
by DOMActive event.

Because BaseChooserOnlyDateAndTimeInputType inherits from
BaseDateAndTimeInputType, it can't inherit
BaseClickableWithKeyInputType. So, this patch adds static helper
functions to BaseClickableWithKeyInputType, and
BaseChooserOnlyDateAndTimeInputType uses them.

This patch doesn't change behavior yet because Chromimum-Android port
intercepts user events and doesn't deliver them to date/time input
elements.

* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
Add an empty implementation with a FIXME comment.
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
Add BaseClickableWithKeyInputType behavior by a helper function.
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent): Ditto.
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent): Ditto.
(WebCore::BaseChooserOnlyDateAndTimeInputType::accessKeyAction): Ditto.
* html/BaseChooserOnlyDateAndTimeInputType.h:
(BaseChooserOnlyDateAndTimeInputType): Add function declarations.
* html/BaseClickableWithKeyInputType.cpp:
Add static helper functions, and existing member functions use them.
* html/BaseClickableWithKeyInputType.h:
(BaseClickableWithKeyInputType): Add declarations of the helper functions.
* html/InputType.h:
(InputType): Make dispatchSimulatedClickIfActive public because it is
called from a helper function.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.cpp
Source/WebCore/html/BaseChooserOnlyDateAndTimeInputType.h
Source/WebCore/html/BaseClickableWithKeyInputType.cpp
Source/WebCore/html/BaseClickableWithKeyInputType.h
Source/WebCore/html/InputType.h