Crash when scrolling soon after page starts loading
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2013 00:58:38 +0000 (00:58 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2013 00:58:38 +0000 (00:58 +0000)
commit7f9320a8cf9a065cb9975cc625ed1b1070ccb054
treee315caa1a0bb853ddbf14c8b9ebd78687c65f7d9
parent0ba6220344743fdf2e728d9dcd07808e762b9161
Crash when scrolling soon after page starts loading
https://bugs.webkit.org/show_bug.cgi?id=109631
<rdar://problem/13157533&13159627&13196727>

Reviewed by Anders Carlsson.

Make the scrolling tree more robust when the root state node,
and/or scrolling node are null. This can happen if we try to
handle a wheel event before we've done the first scrolling
tree commit.

* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::commit): Handle the case where
m_rootStateNode is null. We'll still commit, but the state tree
will have no state nodes.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent): Null-check m_rootNode.
(WebCore::ScrollingTree::commitNewTreeState): Handle a null root node.
(WebCore::ScrollingTree::updateTreeFromStateNode): If the rood state node
is null, just clear the map and null out the root scrolling node.
* page/scrolling/ScrollingTree.h: m_debugInfoLayer was unused.
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::ensureRootStateNodeForFrameView): It may be possible
to get here before we've registered the root scroll layer, in which case scrollLayerID()
will be 0. Assert to see if this can ever happen.
(WebCore::ScrollingCoordinatorMac::scrollingStateTreeAsText): Handle case of rootStateNode()
being null.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/ScrollingStateTree.cpp
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm