Commit 620c6710 authored by nzolghadr's avatar nzolghadr Committed by Commit bot

Suppress mouseup/down when button is NoButton

Chrome sends the mousedown/up in some cases
when the 4th/5th button is pressed/released
without actually sending that button value as
we don't have yet the plumbing needed for that.

BUG=574959

Review URL: https://codereview.chromium.org/1824733006

Cr-Commit-Position: refs/heads/master@{#383812}
parent e99ec407
...@@ -978,6 +978,12 @@ WebInputEventResult EventHandler::handleMousePressEvent(const PlatformMouseEvent ...@@ -978,6 +978,12 @@ WebInputEventResult EventHandler::handleMousePressEvent(const PlatformMouseEvent
{ {
TRACE_EVENT0("blink", "EventHandler::handleMousePressEvent"); 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()); RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
...@@ -1300,6 +1306,12 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve ...@@ -1300,6 +1306,12 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve
{ {
TRACE_EVENT0("blink", "EventHandler::handleMouseReleaseEvent"); 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()); RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
m_frame->selection().setCaretBlinkingSuspended(false); m_frame->selection().setCaretBlinkingSuspended(false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment