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

Unified Diff: third_party/WebKit/Source/core/events/EventDispatcher.cpp

Issue 1894253002: Prevent sending click event for non primary button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing tests 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/events/EventDispatcher.cpp
diff --git a/third_party/WebKit/Source/core/events/EventDispatcher.cpp b/third_party/WebKit/Source/core/events/EventDispatcher.cpp
index c97cc0e40d012f1906676a19a9db2df0f1ace10a..230e8309f875af6f6d38bde3794ea65c5becd183 100644
--- a/third_party/WebKit/Source/core/events/EventDispatcher.cpp
+++ b/third_party/WebKit/Source/core/events/EventDispatcher.cpp
@@ -120,7 +120,13 @@ DispatchEventResult EventDispatcher::dispatch()
ASSERT(m_event->target());
TRACE_EVENT1("devtools.timeline", "EventDispatch", "data", InspectorEventDispatchEvent::data(*m_event));
EventDispatchHandlingState* preDispatchEventHandlerResult = nullptr;
- if (dispatchEventPreProcess(preDispatchEventHandlerResult) == ContinueDispatching) {
dtapuska 2016/04/22 18:32:30 Adding this here seems incorrect and a number of l
Navid Zolghadr 2016/04/22 19:09:58 I realized this file shouldn't be for mouse specif
dtapuska 2016/04/22 19:16:32 What about removing this and adding: if (nati
Navid Zolghadr 2016/04/25 18:37:48 Done.
+
+ bool isClickForNonPrimaryButtons = m_event->isMouseEvent()
+ && toMouseEvent(*m_event).type() == EventTypeNames::click
+ && toMouseEvent(*m_event).button() != MouseButton::LeftButton;
+
+ if (!isClickForNonPrimaryButtons
+ && dispatchEventPreProcess(preDispatchEventHandlerResult) == ContinueDispatching) {
if (dispatchEventAtCapturing() == ContinueDispatching) {
if (dispatchEventAtTarget() == ContinueDispatching)
dispatchEventAtBubbling();

Powered by Google App Engine
This is Rietveld 408576698