Chromium Code Reviews| Index: Source/core/dom/Node.cpp |
| diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
| index eef69a897008bc9610bbd1a4f4d8e68ccaf53cd9..2d922722cd6d27062c182106ab2567ecb6c04856 100644 |
| --- a/Source/core/dom/Node.cpp |
| +++ b/Source/core/dom/Node.cpp |
| @@ -72,6 +72,7 @@ |
| #include "core/events/KeyboardEvent.h" |
| #include "core/events/MouseEvent.h" |
| #include "core/events/MutationEvent.h" |
| +#include "core/events/PointerEvent.h" |
| #include "core/events/TextEvent.h" |
| #include "core/events/TouchEvent.h" |
| #include "core/events/UIEvent.h" |
| @@ -2107,10 +2108,10 @@ void Node::dispatchScopedEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispa |
| bool Node::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) |
| { |
| - if (event->isMouseEvent()) |
| - return EventDispatcher::dispatchEvent(*this, MouseEventDispatchMediator::create(static_pointer_cast<MouseEvent>(event), MouseEventDispatchMediator::SyntheticMouseEvent)); |
| - if (event->isTouchEvent()) |
| - return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event)); |
| + // For a PointerEvent, MouseEvent or TouchEvent, the 'relatedTarget' property must be updated |
| + // during dispatch. This generic dispatcher can't handle this. |
|
Rick Byers
2015/06/11 04:14:56
Doesn't the Javascript EventTarget.dispatchEvent c
mustaq
2015/06/12 16:05:23
Good catch! Back to my first patch here.
|
| + RELEASE_ASSERT(!event->isPointerEvent() && !event->isMouseEvent() && !event->isTouchEvent()); |
| + |
| return EventDispatcher::dispatchEvent(*this, EventDispatchMediator::create(event)); |
| } |
| @@ -2160,6 +2161,11 @@ bool Node::dispatchTouchEvent(PassRefPtrWillBeRawPtr<TouchEvent> event) |
| return EventDispatcher::dispatchEvent(*this, TouchEventDispatchMediator::create(event)); |
| } |
| +bool Node::dispatchPointerEvent(PassRefPtrWillBeRawPtr<PointerEvent> event) |
| +{ |
| + return EventDispatcher::dispatchEvent(*this, PointerEventDispatchMediator::create(event)); |
| +} |
| + |
| void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEventOptions eventOptions) |
| { |
| EventDispatcher::dispatchSimulatedClick(*this, underlyingEvent, eventOptions); |