Title: [173573] trunk/Source/WebKit2
Revision
173573
Author
[email protected]
Date
2014-09-12 13:59:20 -0700 (Fri, 12 Sep 2014)

Log Message

Flash of page scrolled to wrong origin before restoring scroll position after swiping back to CNN front page from an article
https://bugs.webkit.org/show_bug.cgi?id=136788
<rdar://problem/18314597>

Reviewed by Sam Weinig.

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
(WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
Always wait until didFinishLoadForMainFrame or didSameDocumentNavigationForMainFrame
before removing the snapshot, because otherwise we don't know if the scroll
position has been restored yet.

We should revisit this at some point, because it should be possible to
determine if the scroll position has been restored appropriately, but for
now it is safest to restore the antique behavior.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (173572 => 173573)


--- trunk/Source/WebKit2/ChangeLog	2014-09-12 20:46:05 UTC (rev 173572)
+++ trunk/Source/WebKit2/ChangeLog	2014-09-12 20:59:20 UTC (rev 173573)
@@ -1,3 +1,22 @@
+2014-09-12  Tim Horton  <[email protected]>
+
+        Flash of page scrolled to wrong origin before restoring scroll position after swiping back to CNN front page from an article
+        https://bugs.webkit.org/show_bug.cgi?id=136788
+        <rdar://problem/18314597>
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/mac/ViewGestureControllerMac.mm:
+        (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
+        (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
+        Always wait until didFinishLoadForMainFrame or didSameDocumentNavigationForMainFrame
+        before removing the snapshot, because otherwise we don't know if the scroll
+        position has been restored yet.
+
+        We should revisit this at some point, because it should be possible to
+        determine if the scroll position has been restored appropriately, but for
+        now it is safest to restore the antique behavior.
+
 2014-09-12  Dan Bernstein  <[email protected]>
 
         Build fix.

Modified: trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm (173572 => 173573)


--- trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm	2014-09-12 20:46:05 UTC (rev 173572)
+++ trunk/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm	2014-09-12 20:59:20 UTC (rev 173573)
@@ -693,8 +693,10 @@
 
     m_swipeWaitingForRenderTreeSizeThreshold = false;
 
-    if (!m_swipeWaitingForVisuallyNonEmptyLayout)
-        removeSwipeSnapshotAfterRepaint();
+    if (!m_swipeWaitingForVisuallyNonEmptyLayout) {
+        // FIXME: Ideally we would call removeSwipeSnapshotAfterRepaint() here, but sometimes
+        // scroll position isn't done restoring until didFinishLoadForFrame, so we flash the wrong content.
+    }
 }
 
 void ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame()
@@ -704,9 +706,10 @@
 
     m_swipeWaitingForVisuallyNonEmptyLayout = false;
 
-    if (!m_swipeWaitingForRenderTreeSizeThreshold)
-        removeSwipeSnapshotAfterRepaint();
-    else {
+    if (!m_swipeWaitingForRenderTreeSizeThreshold) {
+        // FIXME: Ideally we would call removeSwipeSnapshotAfterRepaint() here, but sometimes
+        // scroll position isn't done restoring until didFinishLoadForFrame, so we flash the wrong content.
+    } else {
         m_swipeWatchdogAfterFirstVisuallyNonEmptyLayoutTimer.startOneShot(swipeSnapshotRemovalWatchdogAfterFirstVisuallyNonEmptyLayoutDuration.count());
         m_swipeWatchdogTimer.stop();
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to