Title: [240542] trunk/Source/WebKit
Revision
240542
Author
timothy_hor...@apple.com
Date
2019-01-25 23:29:15 -0800 (Fri, 25 Jan 2019)

Log Message

REGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter
https://bugs.webkit.org/show_bug.cgi?id=193860
<rdar://problem/47535022>

Reviewed by Antti Koivisto.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
(WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
* UIProcess/Cocoa/ViewGestureController.h:
Treat provisional load and same document load the same: they already both
unpause the snapshot removal tracker, request render tree size notifications,
but same-document navigation was missing the call to dispatchAfterEnsuringDrawing
and thus would get stuck waiting for RepaintAfterNavigation.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (240541 => 240542)


--- trunk/Source/WebKit/ChangeLog	2019-01-26 06:50:58 UTC (rev 240541)
+++ trunk/Source/WebKit/ChangeLog	2019-01-26 07:29:15 UTC (rev 240542)
@@ -1,3 +1,21 @@
+2019-01-25  Tim Horton  <timothy_hor...@apple.com>
+
+        REGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter
+        https://bugs.webkit.org/show_bug.cgi?id=193860
+        <rdar://problem/47535022>
+
+        Reviewed by Antti Koivisto.
+
+        * UIProcess/Cocoa/ViewGestureController.cpp:
+        (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
+        (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
+        (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
+        * UIProcess/Cocoa/ViewGestureController.h:
+        Treat provisional load and same document load the same: they already both
+        unpause the snapshot removal tracker, request render tree size notifications,
+        but same-document navigation was missing the call to dispatchAfterEnsuringDrawing
+        and thus would get stuck waiting for RepaintAfterNavigation.
+
 2019-01-25  Ryosuke Niwa  <rn...@webkit.org>
 
         Need a mechanism to override navigator.userAgent

Modified: trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp (240541 => 240542)


--- trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp	2019-01-26 06:50:58 UTC (rev 240541)
+++ trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp	2019-01-26 07:29:15 UTC (rev 240542)
@@ -145,7 +145,7 @@
     return !!backForwardList.forwardItem();
 }
 
-void ViewGestureController::didStartProvisionalLoadForMainFrame()
+void ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame()
 {
     m_snapshotRemovalTracker.resume();
 #if PLATFORM(MAC)
@@ -152,10 +152,15 @@
     requestRenderTreeSizeNotificationIfNeeded();
 #endif
 
-    if (auto provisionalLoadCallback = WTFMove(m_provisionalLoadCallback))
-        provisionalLoadCallback();
+    if (auto loadCallback = WTFMove(m_loadCallback))
+        loadCallback();
 }
 
+void ViewGestureController::didStartProvisionalLoadForMainFrame()
+{
+    didStartProvisionalOrSameDocumentLoadForMainFrame();
+}
+
 void ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame()
 {
     if (!m_snapshotRemovalTracker.eventOccurred(SnapshotRemovalTracker::VisuallyNonEmptyLayout))
@@ -201,10 +206,7 @@
 
 void ViewGestureController::didSameDocumentNavigationForMainFrame(SameDocumentNavigationType type)
 {
-    m_snapshotRemovalTracker.resume();
-#if PLATFORM(MAC)
-    requestRenderTreeSizeNotificationIfNeeded();
-#endif
+    didStartProvisionalOrSameDocumentLoadForMainFrame();
 
     bool cancelledOutstandingEvent = false;
 

Modified: trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h (240541 => 240542)


--- trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h	2019-01-26 06:50:58 UTC (rev 240541)
+++ trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h	2019-01-26 07:29:15 UTC (rev 240542)
@@ -157,6 +157,8 @@
     void willBeginGesture(ViewGestureType);
     void didEndGesture();
 
+    void didStartProvisionalOrSameDocumentLoadForMainFrame();
+
     class SnapshotRemovalTracker {
     public:
         enum Event : uint8_t {
@@ -321,7 +323,7 @@
     bool m_isConnectedToProcess { false };
 
     SnapshotRemovalTracker m_snapshotRemovalTracker;
-    WTF::Function<void()> m_provisionalLoadCallback;
+    WTF::Function<void()> m_loadCallback;
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm (240541 => 240542)


--- trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm	2019-01-26 06:50:58 UTC (rev 240541)
+++ trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm	2019-01-26 07:29:15 UTC (rev 240542)
@@ -323,7 +323,7 @@
 
     uint64_t pageID = m_webPageProxy.pageID();
     GestureID gestureID = m_currentGestureID;
-    m_provisionalLoadCallback = [this, pageID, gestureID] {
+    m_loadCallback = [this, pageID, gestureID] {
         auto drawingArea = m_webPageProxy.provisionalDrawingArea();
         if (!drawingArea) {
             removeSwipeSnapshot();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to