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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 839253002: Gracefully handle mismatched drag ended notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: test tidying Created 5 years, 11 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 | « LayoutTests/fast/events/drag-extra-mouse-down-no-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 670605d4c5a1648140a9e21d5867a56398450386..c9fa6caa560deed444e2773afef5bf0aca05198e 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -3206,8 +3206,26 @@ void EventHandler::dragSourceEndedAt(const PlatformMouseEvent& event, DragOperat
prepareMouseEvent(request, event);
if (dragState().m_dragSrc) {
+ // If an embedder tries to end a drag operation, but the page
+ // has initiated another from other input events received,
+ // we're in a tight corner. While Blink doesn't pretend to
+ // support concurrent drag operations on a page, it should try
+ // to gracefully handle any such overlapping drag operation
+ // attempts, whatever their cause/source.
+ //
+ // Hence, if the drag state here has a source, but not yet
+ // any drag data, this represents a drag operation just
+ // getting under way. The embedder is thus likely signalling
+ // the end of another, earlier drag operation here, which it
+ // is preferable to silently ignore.
+ // (cf. http://crbug.com/445308)
+ if (!dragState().m_dragDataTransfer)
+ return;
+
dragState().m_dragDataTransfer->setDestinationOperation(operation);
- // for now we don't care if event handler cancels default behavior, since there is none
+
+ // For now we don't care if the event handler cancels the default
+ // behavior, as there is none.
dispatchDragSrcEvent(EventTypeNames::dragend, event);
}
clearDragDataTransfer();
« no previous file with comments | « LayoutTests/fast/events/drag-extra-mouse-down-no-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698