Implement proper handling of focus/blur events in regard to shadow DOM boundaries.
authorhayato@chromium.org <hayato@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Aug 2011 02:41:10 +0000 (02:41 +0000)
committerhayato@chromium.org <hayato@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Aug 2011 02:41:10 +0000 (02:41 +0000)
commit9c560e6c518a900a42a64cbfb9e1b4dd4351c2d3
tree9c99e450448f977b8f865c89a83ea8949ae7f82e
parent49f3cc02dc18ad9814b900f1a386ada44dae0f34
Implement proper handling of focus/blur events in regard to shadow DOM boundaries.
https://bugs.webkit.org/show_bug.cgi?id=61421

Reviewed by Dimitri Glazkov.

Introduces FocusEventDispatchMediator/BlurEventDispatchMediator so
that focus/blue events are stopped at the lowest common shadow boundary.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::setFocusedNode):
* dom/Event.cpp:
(WebCore::FocusEventDispatchMediator::create):
(WebCore::FocusEventDispatchMediator::FocusEventDispatchMediator):
(WebCore::FocusEventDispatchMediator::dispatchEvent):
(WebCore::BlurEventDispatchMediator::create):
(WebCore::BlurEventDispatchMediator::BlurEventDispatchMediator):
(WebCore::BlurEventDispatchMediator::dispatchEvent):
* dom/Event.h:
* dom/Node.cpp:
(WebCore::Node::dispatchFocusEvent):
(WebCore::Node::dispatchBlurEvent):
* dom/Node.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::dispatchBlurEvent):
* html/HTMLFormControlElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::dispatchFocusEvent):
(WebCore::HTMLSelectElement::dispatchBlurEvent):
* html/HTMLSelectElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::dispatchFocusEvent):
(WebCore::HTMLTextFormControlElement::dispatchBlurEvent):
* html/HTMLTextFormControlElement.h:
* page/FocusController.cpp:
(WebCore::dispatchEventsOnWindowAndFocusedNode):

LayoutTests:

* fast/dom/shadow/shadow-boundary-events.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/shadow-boundary-events-expected.txt
LayoutTests/fast/dom/shadow/shadow-boundary-events.html
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Event.cpp
Source/WebCore/dom/Event.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.h
Source/WebCore/page/FocusController.cpp