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 8581d36a79c4af94e669f85882d3a333dabe3376..110b2aded5b9fb00cc8cca387b48c96c9f259c68 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; |
| + } 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,13 @@ 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) { |
|
dtapuska
2016/03/23 18:37:31
braces aren't needed here
|
| + return WebInputEventResult::HandledSystem; |
| + } |
| + |
| updateMouseEventTargetNode(targetNode, mouseEvent); |
| if (!m_nodeUnderMouse) |
| return WebInputEventResult::NotHandled; |