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 8581d36a79c4af94e669f85882d3a333dabe3376..7df48290df4c2e2cd810e2ac6a1e701a363e3611 100644 |
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
@@ -1375,12 +1375,19 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve |
if (Node* clickTargetNode = mev.innerNode()->commonAncestor( |
*m_clickNode, parentForClickEvent)) { |
- // Dispatch mouseup directly w/o calling updateMouseEventTargetNode |
- // 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)); |
+ // For 4th/5th button in the mouse since Chrome does not yet send |
+ // button value to Blink but in some cases it does send the event. |
+ // This check is needed to suppress such an event (crbug.com/574959) |
+ if (mouseEvent.button() == NoButton) { |
+ clickEventResult = WebInputEventResult::HandledSystem; |
mustaq
2016/03/23 19:13:26
I think we should make those buttons completely in
|
+ } else { |
+ // Dispatch mouseup directly w/o calling updateMouseEventTargetNode |
+ // 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)); |
+ } |
} |
} |
@@ -1680,6 +1687,12 @@ WebInputEventResult EventHandler::updatePointerTargetAndDispatchEvents(const Ato |
|| mouseEventType == EventTypeNames::mousemove |
|| mouseEventType == EventTypeNames::mouseup); |
+ // For 4th/5th button in the mouse since Chrome does not yet send |
+ // button value to Blink but in some cases it does send the event. |
+ // This check is needed to suppress such an event (crbug.com/574959) |
+ if (mouseEventType != EventTypeNames::mousemove && mouseEvent.button() == NoButton) |
+ return WebInputEventResult::HandledSystem; |
+ |
updateMouseEventTargetNode(targetNode, mouseEvent); |
if (!m_nodeUnderMouse) |
return WebInputEventResult::NotHandled; |