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

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: Change to HandledSuppressed 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..d54a59bda86a030c94b04326dd606cf383169916 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -977,6 +977,12 @@ WebInputEventResult EventHandler::handleMousePressEvent(const PlatformMouseEvent
{
TRACE_EVENT0("blink", "EventHandler::handleMousePressEvent");
+ // 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)
+ return WebInputEventResult::HandledSuppressed;
+
RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
@@ -1305,6 +1311,12 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve
{
TRACE_EVENT0("blink", "EventHandler::handleMouseReleaseEvent");
+ // 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)
+ return WebInputEventResult::HandledSuppressed;
+
RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
m_frame->selection().setCaretBlinkingSuspended(false);
« 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