[iOS][wk2] Swiping back sometimes results in a missing (not blank) swipe snapshot
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jun 2014 01:32:06 +0000 (01:32 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jun 2014 01:32:06 +0000 (01:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134181

Reviewed by Benjamin Poulain.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::endSwipeGesture):
(WebKit::ViewGestureController::setRenderTreeSize):
(WebKit::ViewGestureController::removeSwipeSnapshot):
* UIProcess/mac/ViewGestureController.h:
Make it explicit that we should only remove the swipe snapshot when a
big-enough render tree size arrives *after the swipe ends*.

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm
Source/WebKit2/UIProcess/mac/ViewGestureController.h

index 5e04ded75e9bf8f6fa368386d217e71e92cede80..ed4e0a79e8d82821c195415a8a2de609e2916bec 100644 (file)
@@ -1,3 +1,19 @@
+2014-06-22  Tim Horton  <timothy_horton@apple.com>
+
+        [iOS][wk2] Swiping back sometimes results in a missing (not blank) swipe snapshot
+        https://bugs.webkit.org/show_bug.cgi?id=134181
+
+        Reviewed by Benjamin Poulain.
+
+        * UIProcess/ios/ViewGestureControllerIOS.mm:
+        (WebKit::ViewGestureController::ViewGestureController):
+        (WebKit::ViewGestureController::endSwipeGesture):
+        (WebKit::ViewGestureController::setRenderTreeSize):
+        (WebKit::ViewGestureController::removeSwipeSnapshot):
+        * UIProcess/mac/ViewGestureController.h:
+        Make it explicit that we should only remove the swipe snapshot when a
+        big-enough render tree size arrives *after the swipe ends*.
+
 2014-06-22  Tim Horton  <timothy_horton@apple.com>
 
         Thread some references through the remote layer tree code
index 28ed6d8e76a56ff5ecbaacbfb228e304e705f3f6..bf700296254e9c092feb5df4135957853569ec06 100644 (file)
@@ -128,6 +128,7 @@ ViewGestureController::ViewGestureController(WebPageProxy& webPageProxy)
     , m_activeGestureType(ViewGestureType::None)
     , m_swipeWatchdogTimer(this, &ViewGestureController::swipeSnapshotWatchdogTimerFired)
     , m_snapshotRemovalTargetRenderTreeSize(0)
+    , m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit(false)
 {
 }
 
@@ -238,6 +239,8 @@ void ViewGestureController::endSwipeGesture(WebBackForwardListItem* targetItem,
     ViewSnapshotStore::shared().enableSnapshotting();
 
     m_swipeWatchdogTimer.startOneShot(swipeSnapshotRemovalWatchdogDuration.count());
+
+    m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit = true;
 }
     
 void ViewGestureController::setRenderTreeSize(uint64_t renderTreeSize)
@@ -245,6 +248,9 @@ void ViewGestureController::setRenderTreeSize(uint64_t renderTreeSize)
     if (m_activeGestureType != ViewGestureType::Swipe)
         return;
 
+    if (!m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit)
+        return;
+
     // Don't remove the swipe snapshot until we get a drawing area transaction more recent than the navigation,
     // and we hit the render tree size threshold. This avoids potentially removing the snapshot early,
     // when receiving commits from the previous (pre-navigation) page.
@@ -259,6 +265,8 @@ void ViewGestureController::swipeSnapshotWatchdogTimerFired(Timer<ViewGestureCon
 
 void ViewGestureController::removeSwipeSnapshot()
 {
+    m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit = false;
+
     m_swipeWatchdogTimer.stop();
 
     if (m_activeGestureType != ViewGestureType::Swipe)
index 8fb3e7e651f4891b1aa26d49ed3b8a1b1bd0cae8..72d682e70bb8e41a730e93489dc1e6fe22235ade 100644 (file)
@@ -185,6 +185,7 @@ private:
     RetainPtr<WKSwipeTransitionController> m_swipeInteractiveTransitionDelegate;
     uint64_t m_snapshotRemovalTargetRenderTreeSize;
     uint64_t m_snapshotRemovalTargetTransactionID;
+    bool m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit;
 #endif
 };