Commit 0ffd0bb1 authored by Ella Ge's avatar Ella Ge Committed by Commit Bot

Do not do InvalidateClick on MouseMove

In this CL, we change reset mouse states in mouse move to
not do MouseReleaseEventUpdateStates, but only ClearDragHeuristicState.
The reason is:
1. click_count_ & click_element_ are set from WebMouseEvent on mousePress.
It won't be incorrect even if we do not receive the MouseUp.
2. On Mac(with software like BBT that trap events), event queue might
got incorrect: a MouseMove with no button down is received&handled
before MouseUp. Therefore click event will not fire since we did the
InvalidateClick() on MouseMove.

This fix won't break crbug.com/527582

Bug: 763642
Change-Id: Ic278412281ba177a23b1a5fffeaa62ae123cc71d
Reviewed-on: https://chromium-review.googlesource.com/726962
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510073}
parent 9ec96ea3
...@@ -781,11 +781,11 @@ WebInputEventResult EventHandler::HandleMouseMoveOrLeaveEvent( ...@@ -781,11 +781,11 @@ WebInputEventResult EventHandler::HandleMouseMoveOrLeaveEvent(
// Mouse states need to be reset when mouse move with no button down. // Mouse states need to be reset when mouse move with no button down.
// This is for popup/context_menu opened at mouse_down event and // This is for popup/context_menu opened at mouse_down event and
// mouse_release is not handled in page. // mouse_release is not handled in page.
// crbug/527582 // crbug.com/527582
if (mouse_event.button == WebPointerProperties::Button::kNoButton && if (mouse_event.button == WebPointerProperties::Button::kNoButton &&
!(mouse_event.GetModifiers() & !(mouse_event.GetModifiers() &
WebInputEvent::Modifiers::kRelativeMotionEvent)) { WebInputEvent::Modifiers::kRelativeMotionEvent)) {
mouse_event_manager_->HandleMouseReleaseEventUpdateStates(); mouse_event_manager_->ClearDragHeuristicState();
if (event_handler_will_reset_capturing_mouse_events_node_) if (event_handler_will_reset_capturing_mouse_events_node_)
capturing_mouse_events_node_ = nullptr; capturing_mouse_events_node_ = nullptr;
} }
......
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