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 0f1e3bc444b01bf13d4ce1a3f3a68de1a6786367..f1be4b37d03a6d0ad54fa087c08573ef3f917a14 100644 |
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
@@ -1150,7 +1150,9 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve |
WebInputEventResult eventResult = updatePointerTargetAndDispatchEvents(EventTypeNames::mouseup, mev.innerNode(), m_clickCount, mev.event()); |
- bool contextMenuEvent = mouseEvent.button() == RightButton; |
+ // We only prevent click event when the click may cause contextmenu to popup. |
+ // However, we always send auxclick. |
+ bool contextMenuEvent = !RuntimeEnabledFeatures::auxclickEnabled() && mouseEvent.button() == RightButton; |
#if OS(MACOSX) |
// FIXME: The Mac port achieves the same behavior by checking whether the context menu is currently open in WebPage::mouseEvent(). Consider merging the implementations. |
if (mouseEvent.button() == LeftButton && mouseEvent.getModifiers() & PlatformEvent::CtrlKey) |
@@ -1183,7 +1185,10 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve |
// correctly. Moreover, clickTargetNode is different from |
// mev.innerNode at drag-release. |
clickEventResult = toWebInputEventResult(clickTargetNode->dispatchMouseEvent(mev.event(), |
- EventTypeNames::click, m_clickCount)); |
+ !RuntimeEnabledFeatures::auxclickEnabled() || (mev.event().button() == MouseButton::LeftButton) |
+ ? EventTypeNames::click |
+ : EventTypeNames::auxclick, |
+ m_clickCount)); |
} |
} |