Occasional crash under AsyncScrollingCoordinator::frameViewRootLayerDidChange() on...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 May 2014 02:26:22 +0000 (02:26 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 May 2014 02:26:22 +0000 (02:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132723

Reviewed by Sam Weinig.

Crash reports suggest that when we call AsyncScrollingCoordinator::frameViewRootLayerDidChange()
from HistoryController::restoreScrollPositionAndViewState(), the FrameView may not have a
scrolling node ID, which suggests that either the FrameView doesn't have a RenderView,
or compositing hasn't happened yet.

So if we enter AsyncScrollingCoordinator::frameViewRootLayerDidChange()
and the FrameView has no scrollLayerID, just return. We'll fix things up
when compositing kicks in later.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):

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

Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

index aa8968e..f5edf2e 100644 (file)
@@ -1,5 +1,24 @@
 2014-05-08  Simon Fraser  <simon.fraser@apple.com>
 
+        Occasional crash under AsyncScrollingCoordinator::frameViewRootLayerDidChange() on history navigation
+        https://bugs.webkit.org/show_bug.cgi?id=132723
+
+        Reviewed by Sam Weinig.
+        
+        Crash reports suggest that when we call AsyncScrollingCoordinator::frameViewRootLayerDidChange()
+        from HistoryController::restoreScrollPositionAndViewState(), the FrameView may not have a 
+        scrolling node ID, which suggests that either the FrameView doesn't have a RenderView,
+        or compositing hasn't happened yet.
+        
+        So if we enter AsyncScrollingCoordinator::frameViewRootLayerDidChange()
+        and the FrameView has no scrollLayerID, just return. We'll fix things up
+        when compositing kicks in later.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
+
+2014-05-08  Simon Fraser  <simon.fraser@apple.com>
+
         [iOS WK2] Bottom-relative position:fixed elements are misplaced on page load
         https://bugs.webkit.org/show_bug.cgi?id=132719
         <rdar://problem/16860837>
index 9e4d1ef..8391514 100644 (file)
@@ -119,7 +119,12 @@ void AsyncScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView
 
     if (!coordinatesScrollingForFrameView(frameView))
         return;
-
+    
+    // FIXME: In some navigation scenarios, the FrameView has no RenderView or that RenderView has not been composited.
+    // This needs cleaning up: https://bugs.webkit.org/show_bug.cgi?id=132724
+    if (!frameView->scrollLayerID())
+        return;
+    
     // If the root layer does not have a ScrollingStateNode, then we should create one.
     ensureRootStateNodeForFrameView(frameView);
     ASSERT(m_scrollingStateTree->rootStateNode());