Add FocusDirection argument to HTMLTextFormControlElement::handleFocusEvent
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2013 06:11:17 +0000 (06:11 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2013 06:11:17 +0000 (06:11 +0000)
commit73525b09cd13c3ead331358bd933a91f7323b4cf
tree58a21485e0647c715d785b5ee2d80f0cb9782ce7
parent80c805b0a7ac09232fa2c7d341b7ffce118fe51b
Add FocusDirection argument to HTMLTextFormControlElement::handleFocusEvent
https://bugs.webkit.org/show_bug.cgi?id=108775

Reviewed by Hajime Morita.

We'd like to add a FocusDirection argument to
HTMLTextFormControlElement::handleFocusEvent in order to fix Bug
108447. This is a preparation for it.

We need to add FocusDirection arguments to some focus-related functions
to pass it correctly when TAB or Shift+TAB is pressed.

No new tests. This doesn't make any behavior changes.

* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::dispatchFocusEvent):
To pass the FocusDirection argument to handleFocusEvent, we need to add
it to dispatchFocusEvent too.
* html/HTMLTextFormControlElement.h:
(HTMLTextFormControlElement):
Add FocusDirection arugment to dispatchFocusEvent.
(WebCore::HTMLTextFormControlElement::handleFocusEvent):
Add FocusDirection argument.

* dom/Node.cpp:
(WebCore::Node::dispatchFocusEvent): Add FocusDirection argument.
* dom/Node.h:
(Node): Ditto.

* dom/Document.cpp:
(WebCore::Document::setFocusedNode): Add FocusDirection argument in
order to pass it to Node::dispatchFocusEvent.
* dom/Document.h:
(Document): Ditto.

* page/FocusController.cpp:
(WebCore::dispatchEventsOnWindowAndFocusedNode):
Adjust Node::dispatchFocusEvent argument.
(WebCore::FocusController::advanceFocusInDocumentOrder):
Pass FocusDirectio to Element::focus.
(WebCore::FocusController::setFocusedNode):
Add FocusDirection argument in order to pass it to Document::setFocusedNode.
(WebCore::FocusController::advanceFocusDirectionallyInContainer):
Pass FocusDirectio to Element::focus.
* page/FocusController.h:
(FocusController): Add FocusDirection argument to setFocusedNode.

* dom/Element.cpp:
(WebCore::Element::focus):
Add FocusDirection argument to pass it to FocusController::setFocusedNode.
* dom/Element.h:
(Element): Ditto.

* WebCore.exp.in:
Update FocusController::setFocusedNode and Document::setFocusedNode.

* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::focus): Adjust FocusDirection argument.
* html/HTMLLabelElement.h:
(HTMLLabelElement): Ditto.
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::focus): Ditto.
* html/HTMLLegendElement.h:
(HTMLLegendElement): Ditto.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::dispatchFocusEvent): Ditto.
* html/HTMLSelectElement.h:
(HTMLSelectElement): Ditto.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultFocus):
Add FocusDirection argument in order to pass it from
HTMLInputElement::focus() to HTMLTextFormControlElement::focus().
(WebCore::HTMLInputElement::focus):
Pass the FocusDirection argument to InputType::focus. See above.
(WebCore::HTMLInputElement::handleFocusEvent):
Adjust FocusDirection argument.
* html/HTMLInputElement.h:
(HTMLInputElement):
* html/InputType.cpp:
(WebCore::InputType::focus): Add FocusDirection argument.
* html/InputType.h:
(InputType): Ditto.

* html/BaseMultipleFieldsDateAndTimeInputType.cpp:
(WebCore::BaseMultipleFieldsDateAndTimeInputType::focus):
Add FocusDirection argument to follow InputType.
* html/BaseMultipleFieldsDateAndTimeInputType.h:
(BaseMultipleFieldsDateAndTimeInputType): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp
Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLLabelElement.cpp
Source/WebCore/html/HTMLLabelElement.h
Source/WebCore/html/HTMLLegendElement.cpp
Source/WebCore/html/HTMLLegendElement.h
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.h
Source/WebCore/html/InputType.cpp
Source/WebCore/html/InputType.h
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/FocusController.h