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

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1894253002: Prevent sending click event for non primary button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove empty line Created 4 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: third_party/WebKit/Source/core/input/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 4a88d4598398c243cde77a02e86ba1b3fd74ad95..29578af2571f00e19cfe642d5594a6ca1355f592 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -1492,8 +1492,13 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve
// because the mouseup dispatch above has already updated it
// correctly. Moreover, clickTargetNode is different from
// mev.innerNode at drag-release.
- clickEventResult = toWebInputEventResult(clickTargetNode->dispatchMouseEvent(mev.event(),
- EventTypeNames::click, m_clickCount));
+ MouseEvent* event = MouseEvent::create(
+ EventTypeNames::click,
+ clickTargetNode->document().domWindow(),
+ mev.event(), m_clickCount, nullptr);
+ if (mev.event().button() != MouseButton::LeftButton)
dtapuska 2016/04/25 19:59:37 Perhaps add a comment about the bug number here?
Navid Zolghadr 2016/04/26 17:04:07 Done.
+ event->stopPropagation();
+ return toWebInputEventResult(clickTargetNode->dispatchEvent(event));
dtapuska 2016/04/25 19:59:36 This is different logic than in the past... clickE
Navid Zolghadr 2016/04/26 17:04:07 My bad! Thanks for catching it.
}
}

Powered by Google App Engine
This is Rietveld 408576698