EventDispatcher::dispatchEvent() should take its Node by reference
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Dec 2016 17:41:28 +0000 (17:41 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Dec 2016 17:41:28 +0000 (17:41 +0000)
commitff655b4623549830c1165652a413ec438981f0c3
tree2235ecd65fb6e7094c1689cc67a8983390e3edd1
parentfe50cab5bc17b26632882d58284c0578c97659d3
EventDispatcher::dispatchEvent() should take its Node by reference
https://bugs.webkit.org/show_bug.cgi?id=165840

Reviewed by Andreas Kling.

No new tests. No change in behavior.

* dom/Element.cpp:
(WebCore::Element::dispatchWheelEvent): Dereferenced |this| when calling
EventDispatcher::dispatchEvent().
(WebCore::Element::dispatchKeyEvent): Ditto.
(WebCore::Element::dispatchFocusEvent): Ditto.
(WebCore::Element::dispatchBlurEvent): Ditto.
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent): Changed |origin| from a Node* to a Node&, renamed
it to |node|, and protected it with a Ref called |protectedNode| to match our preferred
style.
* dom/EventDispatcher.h: Changed dispatchEvent's first parameter type from Node* to Node&.
* dom/Node.cpp:
(WebCore::Node::dispatchEvent): Dereferenced |this| when calling
EventDispatcher::dispatchEvent().
(WebCore::Node::dispatchTouchEvent): Ditto.
(WebCore::Node::dispatchUIRequestEvent): Ditto.
* dom/ScopedEventQueue.cpp:
(WebCore::ScopedEventQueue::dispatchEvent): Dereferenced |node| when calling
EventDispatcher::dispatchEvent().
* dom/SimulatedClick.cpp:
(WebCore::simulateMouseEvent): Passed |element| as a reference to
EventDispatcher::dispatchEvent().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/dom/EventDispatcher.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/ScopedEventQueue.cpp
Source/WebCore/dom/SimulatedClick.cpp