WebKit's focus events are UIEvents (instead of FocusEvent) and thus don't expose...
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 08:30:00 +0000 (08:30 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 08:30:00 +0000 (08:30 +0000)
commit9af6279e81ad0f004ae6cf1b376036e6fa061bd4
tree770caff3f2d3fda346f21a7706fd6eda5018a6a0
parent439b87048e2b462b01c695b2f228d730e382bf67
WebKit's focus events are UIEvents (instead of FocusEvent) and thus don't expose .relatedTarget
https://bugs.webkit.org/show_bug.cgi?id=76216

Reviewed by Eric Seidel.

Spec: http://www.w3.org/TR/DOM-Level-3-Events/#events-FocusEvent

This patch creates a new FocusEvent class with a relatedTarget attribute.
Now when focusin or focusout events are dispatched, a FocusEvent is created with
the relatedTarget attribute set accordingly.

Source/WebCore:

Test: fast/events/related-target-focusevent.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/Event.cpp:
(WebCore::Event::isFocusEvent):
(WebCore):
* dom/Event.h:
(Event):
* dom/EventContext.cpp:
(WebCore::EventContext::handleLocalEvents):
* dom/EventNames.in:
* dom/FocusEvent.h: Added.
(WebCore):
(FocusEvent):
(WebCore::FocusEvent::create):
(WebCore::FocusEvent::relatedTarget):
(WebCore::FocusEvent::setRelatedTarget):
(WebCore::toFocusEvent):
* dom/FocusEvent.idl: Added.
* dom/Node.cpp:
(WebCore::Node::dispatchFocusInEvent):
(WebCore::Node::dispatchFocusOutEvent):

LayoutTests:

* fast/dom/shadow/shadow-boundary-events-expected.txt:
* fast/dom/shadow/shadow-boundary-events.html:
* fast/events/related-target-focusevent-expected.txt: Added.
* fast/events/related-target-focusevent.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/shadow-boundary-events-expected.txt
LayoutTests/fast/dom/shadow/shadow-boundary-events.html
LayoutTests/fast/events/related-target-focusevent-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/related-target-focusevent.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/DerivedSources.pri
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/DOMAllInOne.cpp
Source/WebCore/dom/Event.cpp
Source/WebCore/dom/Event.h
Source/WebCore/dom/EventContext.cpp
Source/WebCore/dom/EventNames.in
Source/WebCore/dom/FocusEvent.cpp [new file with mode: 0644]
Source/WebCore/dom/FocusEvent.h [new file with mode: 0644]
Source/WebCore/dom/FocusEvent.idl [new file with mode: 0644]
Source/WebCore/dom/Node.cpp