Title: [238818] trunk/Source/WebKit
Revision
238818
Author
[email protected]
Date
2018-12-03 13:41:29 -0800 (Mon, 03 Dec 2018)

Log Message

Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
https://bugs.webkit.org/show_bug.cgi?id=192319
<rdar://problem/45928708>

Reviewed by Simon Fraser.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):
In r236966, I reverted slightly too much of r232416.
We still need to defer requesting a presentation update callback until
after the provisional load starts. Otherwise, we could get the callback
while we're in the 'paused' state, and drop it on the floor. That would
then mean that we time out instead of promptly removing the snapshot.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (238817 => 238818)


--- trunk/Source/WebKit/ChangeLog	2018-12-03 21:20:02 UTC (rev 238817)
+++ trunk/Source/WebKit/ChangeLog	2018-12-03 21:41:29 UTC (rev 238818)
@@ -1,3 +1,22 @@
+2018-12-03  Tim Horton  <[email protected]>
+
+        Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
+        https://bugs.webkit.org/show_bug.cgi?id=192319
+        <rdar://problem/45928708>
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/Cocoa/ViewGestureController.cpp:
+        (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
+        * UIProcess/Cocoa/ViewGestureController.h:
+        * UIProcess/ios/ViewGestureControllerIOS.mm:
+        (WebKit::ViewGestureController::endSwipeGesture):
+        In r236966, I reverted slightly too much of r232416.
+        We still need to defer requesting a presentation update callback until
+        after the provisional load starts. Otherwise, we could get the callback
+        while we're in the 'paused' state, and drop it on the floor. That would
+        then mean that we time out instead of promptly removing the snapshot.
+
 2018-12-03  Alex Christensen  <[email protected]>
 
         Update process assertions after swapping processes

Modified: trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp (238817 => 238818)


--- trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp	2018-12-03 21:20:02 UTC (rev 238817)
+++ trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp	2018-12-03 21:41:29 UTC (rev 238818)
@@ -148,6 +148,9 @@
 void ViewGestureController::didStartProvisionalLoadForMainFrame()
 {
     m_snapshotRemovalTracker.resume();
+
+    if (auto provisionalLoadCallback = WTFMove(m_provisionalLoadCallback))
+        provisionalLoadCallback();
 }
 
 void ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame()

Modified: trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h (238817 => 238818)


--- trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h	2018-12-03 21:20:02 UTC (rev 238817)
+++ trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h	2018-12-03 21:41:29 UTC (rev 238818)
@@ -312,6 +312,7 @@
     bool m_isConnectedToProcess { false };
 
     SnapshotRemovalTracker m_snapshotRemovalTracker;
+    WTF::Function<void()> m_provisionalLoadCallback;
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm (238817 => 238818)


--- trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm	2018-12-03 21:20:02 UTC (rev 238817)
+++ trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm	2018-12-03 21:41:29 UTC (rev 238818)
@@ -300,19 +300,6 @@
         return;
     }
 
-    if (auto drawingArea = m_webPageProxy.drawingArea()) {
-        uint64_t pageID = m_webPageProxy.pageID();
-        GestureID gestureID = m_currentGestureID;
-        drawingArea->dispatchAfterEnsuringDrawing([pageID, gestureID] (CallbackBase::Error error) {
-            if (auto gestureController = controllerForGesture(pageID, gestureID))
-                gestureController->willCommitPostSwipeTransitionLayerTree(error == CallbackBase::Error::None);
-        });
-        drawingArea->hideContentUntilPendingUpdate();
-    } else {
-        removeSwipeSnapshot();
-        return;
-    }
-
     // FIXME: Should we wait for VisuallyNonEmptyLayout like we do on Mac?
     m_snapshotRemovalTracker.start(SnapshotRemovalTracker::RenderTreeSizeThreshold
         | SnapshotRemovalTracker::RepaintAfterNavigation
@@ -326,6 +313,22 @@
         m_backgroundColorForCurrentSnapshot = snapshot->backgroundColor();
         m_webPageProxy.didChangeBackgroundColor();
     }
+
+    uint64_t pageID = m_webPageProxy.pageID();
+    GestureID gestureID = m_currentGestureID;
+    m_provisionalLoadCallback = [this, pageID, gestureID] {
+        auto drawingArea = m_webPageProxy.drawingArea();
+        if (!drawingArea) {
+            removeSwipeSnapshot();
+            return;
+        }
+
+        drawingArea->dispatchAfterEnsuringDrawing([pageID, gestureID] (CallbackBase::Error error) {
+            if (auto gestureController = controllerForGesture(pageID, gestureID))
+                gestureController->willCommitPostSwipeTransitionLayerTree(error == CallbackBase::Error::None);
+        });
+        drawingArea->hideContentUntilPendingUpdate();
+    };
 }
 
 void ViewGestureController::setRenderTreeSize(uint64_t renderTreeSize)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to