Title: [238869] tags/Safari-607.1.16/Source/WebKit
Revision
238869
Author
alanc...@apple.com
Date
2018-12-04 12:00:55 -0800 (Tue, 04 Dec 2018)

Log Message

Cherry-pick r238818. rdar://problem/45928708

    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.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238818 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: tags/Safari-607.1.16/Source/WebKit/ChangeLog (238868 => 238869)


--- tags/Safari-607.1.16/Source/WebKit/ChangeLog	2018-12-04 19:44:45 UTC (rev 238868)
+++ tags/Safari-607.1.16/Source/WebKit/ChangeLog	2018-12-04 20:00:55 UTC (rev 238869)
@@ -1,5 +1,48 @@
 2018-12-04  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r238818. rdar://problem/45928708
+
+    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.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-12-03  Tim Horton  <timothy_hor...@apple.com>
+
+            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-04  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r238849. rdar://problem/46427844
 
     Fix the watchOS build; stop unnecessarily linking CorePDF

Modified: tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp (238868 => 238869)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp	2018-12-04 19:44:45 UTC (rev 238868)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp	2018-12-04 20:00:55 UTC (rev 238869)
@@ -148,6 +148,9 @@
 void ViewGestureController::didStartProvisionalLoadForMainFrame()
 {
     m_snapshotRemovalTracker.resume();
+
+    if (auto provisionalLoadCallback = WTFMove(m_provisionalLoadCallback))
+        provisionalLoadCallback();
 }
 
 void ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame()

Modified: tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h (238868 => 238869)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h	2018-12-04 19:44:45 UTC (rev 238868)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h	2018-12-04 20:00:55 UTC (rev 238869)
@@ -312,6 +312,7 @@
     bool m_isConnectedToProcess { false };
 
     SnapshotRemovalTracker m_snapshotRemovalTracker;
+    WTF::Function<void()> m_provisionalLoadCallback;
 };
 
 } // namespace WebKit

Modified: tags/Safari-607.1.16/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm (238868 => 238869)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm	2018-12-04 19:44:45 UTC (rev 238868)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm	2018-12-04 20:00:55 UTC (rev 238869)
@@ -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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to