Chromium Code Reviews
DescriptionDrag and drop cleans up touch sequences from the source window.
Previously we would just leave the source window thinking it had
a pointer touching it the whole time, and then when a new pointer
came down, we'd ignore that event. This behavior is required for
tab drag, but not for drag and drop.
This caused problems for OOPIF/webview event targetting.
This patch sends cancel events correctly in the drag and drop
case. This is a bit tricky, because during drag and drop, we move
a gesture recognizer from the source window to the destination
window, leaving the source window with no gesture recognition
state. To deal with this, we send press events to the gesture
recognizer without sending them to the associated window, to get
the gesture recognizer state for the source window back in sync
with the pointers that are active on it, and then we dispatch
cancel events to the source window.
Ideally we'd just clone the GR state and then send the cancel
events, but cloning the GR state would be painful.
The tab drag case is left untouched - when dragging a tab,
the source window continues to think that a pointer is down
throughout the tab drag, until the finger is raised.
BUG=604454
TEST=GestureProviderAuraTest.IgnoresExtraPressEvents, GestureRecognizerTest.PressDoesNotCrash
Committed: https://crrev.com/4ab3ab417ec9ddaa3672219ea3dba4e8b35f1518
Cr-Commit-Position: refs/heads/master@{#393568}
Patch Set 1 #Patch Set 2 : Split up tab drag and drag and drop. #Patch Set 3 : Fix tests, cleanup. #Patch Set 4 : Fix another test. #
Total comments: 6
Patch Set 5 : Update GR state without actually dispatching press events. #
Total comments: 2
Patch Set 6 : Add DCHECK. #
Total comments: 1
Patch Set 7 : Merge event transfer methods. #Patch Set 8 : Replace bool with enum. #Patch Set 9 : Fix comment. #Patch Set 10 : More comment fixes. #Patch Set 11 : Fix Mac. #Messages
Total messages: 56 (23 generated)
|