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

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

Issue 2042333006: Reset drag state variables on mouse up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Applying the comments Created 4 years, 5 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 | « third_party/WebKit/Source/core/input/EventHandler.h ('k') | 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 04b488f2cf5755fc2d017c11b7f5758beeeb7fc9..864f214974333ffe74678e4e1a98886a0f6a7b53 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -436,13 +436,6 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const MouseEventWithHi
if (controller && controller->autoscrollInProgress())
m_scrollManager.stopAutoscroll();
- // Used to prevent mouseMoveEvent from initiating a drag before
- // the mouse is pressed again.
- m_mousePressed = false;
- m_capturesDragging = false;
- m_mouseDownMayStartDrag = false;
- m_mouseDownMayStartAutoscroll = false;
-
return selectionController().handleMouseReleaseEvent(event, m_dragStartPos) ? WebInputEventResult::HandledSystem : WebInputEventResult::NotHandled;
}
@@ -1212,6 +1205,7 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve
if (eventResult == WebInputEventResult::NotHandled)
eventResult = handleMouseReleaseEvent(mev);
+ clearDragHeuristicState();
invalidateClick();
@@ -1389,6 +1383,16 @@ WebInputEventResult EventHandler::performDragAndDrop(const PlatformMouseEvent& e
return result;
}
+void EventHandler::clearDragHeuristicState()
+{
+ // Used to prevent mouseMoveEvent from initiating a drag before
+ // the mouse is pressed again.
+ m_mousePressed = false;
+ m_capturesDragging = false;
+ m_mouseDownMayStartDrag = false;
+ m_mouseDownMayStartAutoscroll = false;
+}
+
void EventHandler::clearDragState()
{
m_scrollManager.stopAutoscroll();
@@ -1874,6 +1878,7 @@ WebInputEventResult EventHandler::handleGestureTap(const GestureEventWithHitTest
if (mouseUpEventResult == WebInputEventResult::NotHandled)
mouseUpEventResult = handleMouseReleaseEvent(MouseEventWithHitTestResults(fakeMouseUp, currentHitTest));
+ clearDragHeuristicState();
WebInputEventResult eventResult = mergeEventResult(mergeEventResult(mouseDownEventResult, mouseUpEventResult), clickEventResult);
if (eventResult == WebInputEventResult::NotHandled && tappedNode && m_frame->page()) {
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698