Chromium Code Reviews| 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 0d12edaba07fdd4422f52c88d0470b388c743200..69ea301be75d9697b8bbe72cc4ef1c08d61ded12 100644 |
| --- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
| +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| @@ -1150,16 +1150,18 @@ 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 macContextMenuEvent = false; |
|
bokan
2016/08/12 15:29:17
Is this a change in behaviour? It looks like we'd
Navid Zolghadr
2016/08/12 15:39:16
That is correct. But not quite a change in the beh
bokan
2016/08/12 15:42:20
Got it. But if RuntimeEnabledFeatures::auxclickEna
Navid Zolghadr
2016/08/12 16:01:18
Right. Thanks for the catch. I'm surprised why the
|
| #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) |
| - contextMenuEvent = true; |
| + macContextMenuEvent = true; |
| #endif |
| WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; |
| const bool shouldDispatchClickEvent = m_clickCount > 0 |
| - && !contextMenuEvent |
| + && !macContextMenuEvent |
| && mev.innerNode() && m_clickNode |
| && mev.innerNode()->canParticipateInFlatTree() && m_clickNode->canParticipateInFlatTree() |
| && !(selectionController().hasExtendedSelection() && isLinkSelection(mev)); |
| @@ -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)); |
| } |
| } |