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

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

Issue 2973963003: Release mouse pointer capture when it starts drag (Closed)
Patch Set: Remove is_cancel from parameters Created 3 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
Index: third_party/WebKit/Source/core/input/MouseEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/MouseEventManager.cpp b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
index e4a1ec7df78bfad490fc49ea7b359e7fa48cdcce..ffe57a1eaf1008680cf7a9db724222ecec4083c7 100644
--- a/third_party/WebKit/Source/core/input/MouseEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
@@ -873,6 +873,16 @@ bool MouseEventManager::HandleDrag(const MouseEventWithHitTestResults& event,
// Something failed to start the drag, clean up.
ClearDragDataTransfer();
ResetDragState();
+ } else {
+ // Since drag operation started we need to send a pointercancel for the
+ // corresponding pointer.
+ if (initiator == DragInitiator::kMouse) {
+ frame_->GetEventHandler().HandlePointerEvent(
+ WebPointerEvent(WebInputEvent::Type::kPointerCancel, event.Event()),
+ event.InnerNode());
+ }
+ // TODO(crbug.com/708278): If the drag starts with touch the touch cancel
+ // should trigger the release of pointer capture.
}
mouse_down_may_start_drag_ = false;

Powered by Google App Engine
This is Rietveld 408576698