INPUT_MULTIPLE_FIELDS_UI: Should not move focus if the element already has focus
https://bugs.webkit.org/show_bug.cgi?id=108914

Reviewed by Kentaro Hara.

Source/WebCore:

If timeInput.focus() is called when a sub-field of the time input
already has focus, we should not focus on the first sub-field of the
time input.

Test: fast/forms/time-multiple-fields/time-multiple-fields-focus.html

* html/BaseMultipleFieldsDateAndTimeInputType.cpp:
(WebCore::BaseMultipleFieldsDateAndTimeInputType::willCancelFocus): If
the input elment already has focused sub-field, we don't need to proceed
focus handling. FocusDirection check is required because we don't need
to do this in cases of sequential focus navigation.
* html/BaseMultipleFieldsDateAndTimeInputType.h:
(BaseMultipleFieldsDateAndTimeInputType): Override InputType::willCancelFocus.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::focus):
Cancel focus if InputType::willCancelFocus returns true.
* html/HTMLInputElement.h:
(HTMLInputElement): Override focus.
* html/InputType.cpp:
(WebCore::InputType::willCancelFocus):
Add a default implementation. It returns false.
* html/InputType.h:
(InputType): Declare willCancelFocus.

LayoutTests:

* fast/forms/time-multiple-fields/time-multiple-fields-focus-expected.txt: Added.
* fast/forms/time-multiple-fields/time-multiple-fields-focus.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141887 268f45cc-cd09-0410-ab3c-d52691b4dbfc