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

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: Created 4 years, 6 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 39b426486a0639eba217e8c0ba1b7182be1cd34e..fba7033769e61402e09d12b0623f42c6df1b260d 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -432,12 +432,7 @@ 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;
+ clearMouseDragState();
return selectionController().handleMouseReleaseEvent(event, m_dragStartPos) ? WebInputEventResult::HandledSystem : WebInputEventResult::NotHandled;
}
@@ -1206,6 +1201,8 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve
if (eventResult == WebInputEventResult::NotHandled)
eventResult = handleMouseReleaseEvent(mev);
+ else
+ clearMouseDragState();
dtapuska 2016/06/09 21:18:58 what about the code path for gesture tap that has
mustaq 2016/06/10 15:44:04 handleMousePressEvent(MouseEventWithHitTestResults
Navid Zolghadr 2016/06/10 19:19:55 I added the call as suggested to the tap flow as w
mustaq 2016/06/10 19:30:16 I am indifferent about AutoReset here, mainly for
invalidateClick();
@@ -1383,6 +1380,16 @@ WebInputEventResult EventHandler::performDragAndDrop(const PlatformMouseEvent& e
return result;
}
+void EventHandler::clearMouseDragState()
+{
+ // 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();
« 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