[iOS][wk2] Swipe snapshots are removed too quickly if there is no saved render tree...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jun 2014 23:48:13 +0000 (23:48 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jun 2014 23:48:13 +0000 (23:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133891

Reviewed by Simon Fraser.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):
(WebKit::ViewGestureController::setRenderTreeSize):
If we don't know the target render tree size, wait until the first layer tree commit
that comes in, instead of removing the snapshot when the gesture ends.

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm

index 85142c90cedcff2bc1c978018b137ef38724909c..3cffa7694b57a5a65d2440e55f61af94ed2deba7 100644 (file)
@@ -1,3 +1,16 @@
+2014-06-16  Timothy Horton  <timothy_horton@apple.com>
+
+        [iOS][wk2] Swipe snapshots are removed too quickly if there is no saved render tree size
+        https://bugs.webkit.org/show_bug.cgi?id=133891
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/ios/ViewGestureControllerIOS.mm:
+        (WebKit::ViewGestureController::endSwipeGesture):
+        (WebKit::ViewGestureController::setRenderTreeSize):
+        If we don't know the target render tree size, wait until the first layer tree commit
+        that comes in, instead of removing the snapshot when the gesture ends.
+
 2014-06-16  Timothy Horton  <timothy_horton@apple.com>
 
         [iOS][wk2] Swiping back briefly shows the previous page before loading the new one
index bedb5a24e270458cb87bd42336e62b52ffba41d2..28ed6d8e76a56ff5ecbaacbfb228e304e705f3f6 100644 (file)
@@ -236,11 +236,6 @@ void ViewGestureController::endSwipeGesture(WebBackForwardListItem* targetItem,
     ViewSnapshotStore::shared().disableSnapshotting();
     m_webPageProxy.goToBackForwardItem(targetItem);
     ViewSnapshotStore::shared().enableSnapshotting();
-    
-    if (!m_snapshotRemovalTargetRenderTreeSize) {
-        removeSwipeSnapshot();
-        return;
-    }
 
     m_swipeWatchdogTimer.startOneShot(swipeSnapshotRemovalWatchdogDuration.count());
 }
@@ -253,7 +248,7 @@ void ViewGestureController::setRenderTreeSize(uint64_t renderTreeSize)
     // 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.
-    if (m_snapshotRemovalTargetRenderTreeSize && renderTreeSize > m_snapshotRemovalTargetRenderTreeSize && m_webPageProxy.drawingArea()->lastVisibleTransactionID() >= m_snapshotRemovalTargetTransactionID)
+    if ((!m_snapshotRemovalTargetRenderTreeSize || renderTreeSize > m_snapshotRemovalTargetRenderTreeSize) && m_webPageProxy.drawingArea()->lastVisibleTransactionID() >= m_snapshotRemovalTargetTransactionID)
         removeSwipeSnapshot();
 }