Title: [253450] trunk
Revision
253450
Author
[email protected]
Date
2019-12-12 15:53:40 -0800 (Thu, 12 Dec 2019)

Log Message

Regression(r253394) swipe/basic-cached-back-swipe.html is timing out on iOS
https://bugs.webkit.org/show_bug.cgi?id=205173

Reviewed by Tim Horton.

Source/WebKit:

Test test was calling beginSimulatedSwipeInDirectionForTesting / completeSimulatedSwipeInDirectionForTesting
on the ViewGestureController. This was causing beginSwipeGesture() and endSwipeGesture() but not
willEndSwipeGesture(). This was causing the timeout since willEndSwipeGesture() now actually triggers the
load.

This patch also gets rid of the SnapshotRemovalTracker::SwipeAnimationEnd. We don't really need it since
we already wait for SnapshotRemovalTracker::RepaintAfterNavigation and we won't repaint until the swipe
animation is over (due to the layer tree being frozen during the swipe animation). The SwipeAnimationEnd
was causing trouble because the provisional load may not have started yet by the time endSwipeGesture()
is called, which means that the call to eventOccurred(SwipeAnimationEnd) would get ignored because the
SnapshotRemovalTracker is still paused (it gets unpaused when the provisional load actually starts).

* UIProcess/ViewGestureController.h:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::willEndSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):

LayoutTests:

* platform/ios/swipe/basic-cached-back-swipe-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (253449 => 253450)


--- trunk/LayoutTests/ChangeLog	2019-12-12 23:42:04 UTC (rev 253449)
+++ trunk/LayoutTests/ChangeLog	2019-12-12 23:53:40 UTC (rev 253450)
@@ -1,5 +1,14 @@
 2019-12-12  Chris Dumez  <[email protected]>
 
+        Regression(r253394) swipe/basic-cached-back-swipe.html is timing out on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=205173
+
+        Reviewed by Tim Horton.
+
+        * platform/ios/swipe/basic-cached-back-swipe-expected.txt:
+
+2019-12-12  Chris Dumez  <[email protected]>
+
         Unreviewed, try to address flakiness of http/tests/cache-storage/page-cache-domcache-pending-promise.html on EWS
 
         * http/tests/cache-storage/page-cache-domcache-pending-promise.html:

Modified: trunk/LayoutTests/platform/ios/swipe/basic-cached-back-swipe-expected.txt (253449 => 253450)


--- trunk/LayoutTests/platform/ios/swipe/basic-cached-back-swipe-expected.txt	2019-12-12 23:42:04 UTC (rev 253449)
+++ trunk/LayoutTests/platform/ios/swipe/basic-cached-back-swipe-expected.txt	2019-12-12 23:53:40 UTC (rev 253450)
@@ -1,6 +1,7 @@
 startSwipeGesture
 didBeginSwipe
 completeSwipeGesture
+willEndSwipe
 didEndSwipe
 didRemoveSwipeSnapshot
 

Modified: trunk/Source/WebKit/ChangeLog (253449 => 253450)


--- trunk/Source/WebKit/ChangeLog	2019-12-12 23:42:04 UTC (rev 253449)
+++ trunk/Source/WebKit/ChangeLog	2019-12-12 23:53:40 UTC (rev 253450)
@@ -1,3 +1,28 @@
+2019-12-12  Chris Dumez  <[email protected]>
+
+        Regression(r253394) swipe/basic-cached-back-swipe.html is timing out on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=205173
+
+        Reviewed by Tim Horton.
+
+        Test test was calling beginSimulatedSwipeInDirectionForTesting / completeSimulatedSwipeInDirectionForTesting
+        on the ViewGestureController. This was causing beginSwipeGesture() and endSwipeGesture() but not
+        willEndSwipeGesture(). This was causing the timeout since willEndSwipeGesture() now actually triggers the
+        load.
+
+        This patch also gets rid of the SnapshotRemovalTracker::SwipeAnimationEnd. We don't really need it since
+        we already wait for SnapshotRemovalTracker::RepaintAfterNavigation and we won't repaint until the swipe
+        animation is over (due to the layer tree being frozen during the swipe animation). The SwipeAnimationEnd
+        was causing trouble because the provisional load may not have started yet by the time endSwipeGesture()
+        is called, which means that the call to eventOccurred(SwipeAnimationEnd) would get ignored because the
+        SnapshotRemovalTracker is still paused (it gets unpaused when the provisional load actually starts).
+
+        * UIProcess/ViewGestureController.h:
+        * UIProcess/ios/ViewGestureControllerIOS.mm:
+        (WebKit::ViewGestureController::beginSwipeGesture):
+        (WebKit::ViewGestureController::willEndSwipeGesture):
+        (WebKit::ViewGestureController::endSwipeGesture):
+
 2019-12-12  Alex Christensen  <[email protected]>
 
         NetworkDataTaskCocoa and NetworkSessionCocoa should use public methods instead of being friends

Modified: trunk/Source/WebKit/UIProcess/ViewGestureController.h (253449 => 253450)


--- trunk/Source/WebKit/UIProcess/ViewGestureController.h	2019-12-12 23:42:04 UTC (rev 253449)
+++ trunk/Source/WebKit/UIProcess/ViewGestureController.h	2019-12-12 23:53:40 UTC (rev 253450)
@@ -366,6 +366,7 @@
     RetainPtr<WKSwipeTransitionController> m_swipeInteractiveTransitionDelegate;
     RetainPtr<_UIViewControllerOneToOneTransitionContext> m_swipeTransitionContext;
     uint64_t m_snapshotRemovalTargetRenderTreeSize { 0 };
+    bool m_didCallWillEndSwipeGesture { false };
 #endif
 
 #if PLATFORM(GTK)

Modified: trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm (253449 => 253450)


--- trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm	2019-12-12 23:42:04 UTC (rev 253449)
+++ trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm	2019-12-12 23:53:40 UTC (rev 253450)
@@ -257,6 +257,7 @@
     [m_swipeTransitionContext _setAnimator:animationController.get()];
     [m_swipeTransitionContext _setInteractor:transition];
     [m_swipeTransitionContext _setTransitionIsInFlight:YES];
+    m_didCallWillEndSwipeGesture = false;
     [m_swipeTransitionContext _setInteractiveUpdateHandler:^(BOOL finish, CGFloat percent, BOOL transitionCompleted, _UIViewControllerTransitionContext *) {
         if (finish)
             willEndSwipeGesture(*targetItem, !transitionCompleted);
@@ -274,6 +275,7 @@
 
 void ViewGestureController::willEndSwipeGesture(WebBackForwardListItem& targetItem, bool cancelled)
 {
+    m_didCallWillEndSwipeGesture = true;
     m_webPageProxyForBackForwardListForCurrentSwipe->navigationGestureWillEnd(!cancelled, targetItem);
 
     if (cancelled)
@@ -298,8 +300,7 @@
         | SnapshotRemovalTracker::RepaintAfterNavigation
         | SnapshotRemovalTracker::MainFrameLoad
         | SnapshotRemovalTracker::SubresourceLoads
-        | SnapshotRemovalTracker::ScrollPositionRestoration
-        | SnapshotRemovalTracker::SwipeAnimationEnd, [this] {
+        | SnapshotRemovalTracker::ScrollPositionRestoration, [this] {
         this->removeSwipeSnapshot();
     });
 
@@ -311,6 +312,10 @@
 
 void ViewGestureController::endSwipeGesture(WebBackForwardListItem* targetItem, _UIViewControllerTransitionContext *context, bool cancelled)
 {
+    // At least in the context of a simulated swipe, it is possible that endSwipeGesture() gets called but not willEndSwipeGesture().
+    if (!m_didCallWillEndSwipeGesture)
+        willEndSwipeGesture(*targetItem, cancelled);
+
     [context _setTransitionIsInFlight:NO];
     [context _setInteractor:nil];
     [context _setAnimator:nil];
@@ -332,8 +337,6 @@
         return;
     }
 
-    m_snapshotRemovalTracker.eventOccurred(SnapshotRemovalTracker::SwipeAnimationEnd);
-
     m_webPageProxyForBackForwardListForCurrentSwipe->navigationGestureDidEnd(true, *targetItem);
     if (&m_webPageProxy != m_webPageProxyForBackForwardListForCurrentSwipe)
         m_webPageProxy.navigationGestureDidEnd();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to