Index: Source/core/dom/Node.cpp |
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
index aa67a5ea3fc523d3fff4d823531b89ee4e66fac3..b8e9cbc61c6377e69b2d57449986df40067fc249 100644 |
--- a/Source/core/dom/Node.cpp |
+++ b/Source/core/dom/Node.cpp |
@@ -2102,8 +2102,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->isMouseEvent()) { |
+ toMouseEvent(*event).setFromScript(); |
+ return dispatchMouseEvent(static_pointer_cast<MouseEvent>(event)); |
+ } |
if (event->isTouchEvent()) |
return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event)); |
return EventDispatcher::dispatchEvent(*this, EventDispatchMediator::create(event)); |
@@ -2142,6 +2144,11 @@ bool Node::dispatchMouseEvent(const PlatformMouseEvent& event, const AtomicStrin |
return EventDispatcher::dispatchEvent(*this, MouseEventDispatchMediator::create(MouseEvent::create(eventType, document().domWindow(), event, detail, relatedTarget))); |
} |
+bool Node::dispatchMouseEvent(PassRefPtrWillBeRawPtr<MouseEvent> event) |
+{ |
+ return EventDispatcher::dispatchEvent(*this, MouseEventDispatchMediator::create(event)); |
+} |
+ |
bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) |
{ |
RefPtrWillBeRawPtr<GestureEvent> gestureEvent = GestureEvent::create(document().domWindow(), event); |