Title: [246239] trunk/Source/WebKit
Revision
246239
Author
[email protected]
Date
2019-06-09 13:03:16 -0700 (Sun, 09 Jun 2019)

Log Message

Drag starting state can get stuck even though the drag has ended
https://bugs.webkit.org/show_bug.cgi?id=198696
<rdar://problem/51556045>

Reviewed by Wenson Hsieh.

In iOS 13, we're seeing cases of the DragSession not
correctly ending, and thus leaving m_isStartingDrag in
an incorrect state. Temporarily force this to be reset
in ::dragEnded while investigating

* UIProcess/ios/WKContentViewInteraction.mm: Add some more release logging
while here.
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
(-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dragEnded):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (246238 => 246239)


--- trunk/Source/WebKit/ChangeLog	2019-06-09 11:55:29 UTC (rev 246238)
+++ trunk/Source/WebKit/ChangeLog	2019-06-09 20:03:16 UTC (rev 246239)
@@ -1,3 +1,23 @@
+2019-06-08  Dean Jackson  <[email protected]>
+
+        Drag starting state can get stuck even though the drag has ended
+        https://bugs.webkit.org/show_bug.cgi?id=198696
+        <rdar://problem/51556045>
+
+        Reviewed by Wenson Hsieh.
+
+        In iOS 13, we're seeing cases of the DragSession not
+        correctly ending, and thus leaving m_isStartingDrag in
+        an incorrect state. Temporarily force this to be reset
+        in ::dragEnded while investigating
+
+        * UIProcess/ios/WKContentViewInteraction.mm: Add some more release logging
+        while here.
+        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
+        (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::dragEnded):
+
 2019-06-08  Wenson Hsieh  <[email protected]>
 
         [iOS] The default application name for user agent when requesting desktop content is still "Mobile/15E148"

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (246238 => 246239)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-06-09 11:55:29 UTC (rev 246238)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-06-09 20:03:16 UTC (rev 246239)
@@ -6730,6 +6730,7 @@
 
 - (void)dragInteraction:(UIDragInteraction *)interaction willAnimateLiftWithAnimator:(id <UIDragAnimating>)animator session:(id <UIDragSession>)session
 {
+    RELEASE_LOG(DragAndDrop, "Drag session willAnimateLiftWithAnimator: %p", session);
     if (!_shouldRestoreCalloutBarAfterDrop && _dragDropInteractionState.anyActiveDragSourceIs(WebCore::DragSourceActionSelection)) {
         // FIXME: This SPI should be renamed in UIKit to reflect a more general purpose of hiding interaction assistant controls.
         [_textSelectionAssistant willStartScrollingOverflow];
@@ -6748,6 +6749,10 @@
             [protectedSelf cleanUpDragSourceSessionState];
             page->dragEnded(positionForDragEnd, positionForDragEnd, WebCore::DragOperationNone);
         }
+#if !RELEASE_LOG_DISABLED
+        else
+            RELEASE_LOG(DragAndDrop, "Drag session did not end at start: %p", session);
+#endif
     }];
 }
 
@@ -6799,7 +6804,9 @@
 
 - (void)dragInteraction:(UIDragInteraction *)interaction item:(UIDragItem *)item willAnimateCancelWithAnimator:(id <UIDragAnimating>)animator
 {
+    RELEASE_LOG(DragAndDrop, "Drag interaction willAnimateCancelWithAnimator");
     [animator addCompletion:[protectedSelf = retainPtr(self), page = _page] (UIViewAnimatingPosition finalPosition) {
+        RELEASE_LOG(DragAndDrop, "Drag interaction willAnimateCancelWithAnimator (animation completion block fired)");
         page->dragCancelled();
         if (auto completion = protectedSelf->_dragDropInteractionState.takeDragCancelSetDownBlock()) {
             page->callAfterNextPresentationUpdate([completion] (WebKit::CallbackBase::Error) {

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (246238 => 246239)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-06-09 11:55:29 UTC (rev 246238)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-06-09 20:03:16 UTC (rev 246239)
@@ -3911,6 +3911,8 @@
     m_page->mainFrame().eventHandler().dragSourceEndedAt(event, (DragOperation)operation);
 
     send(Messages::WebPageProxy::DidEndDragging());
+
+    m_isStartingDrag = false;
 }
 
 void WebPage::willPerformLoadDragDestinationAction()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to