Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: Source/core/dom/Node.cpp

Issue 894913002: Prevent default actions for JS-generated mouse events other than click (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: changed failing tests to use eventsender Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index a74976298f34febfd53070af0f9f9101479e22c4..9b6068ef9943ad220e383457f74814f56b3abbc1 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -2060,8 +2060,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 EventDispatcher::dispatchEvent(*this, MouseEventDispatchMediator::create(static_pointer_cast<MouseEvent>(event)));
+ }
if (event->isTouchEvent())
return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event));
return EventDispatcher::dispatchEvent(*this, EventDispatchMediator::create(event));

Powered by Google App Engine
This is Rietveld 408576698