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

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1824733006: Suppress mouseup/down when button is NoButton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing redundant braces Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698