Bad cast when CSS position programmatically changed from -webkit-sticky to fixed
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Oct 2016 01:05:06 +0000 (01:05 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Oct 2016 01:05:06 +0000 (01:05 +0000)
commitc79662a9464af50ce4f64949dc86b17a8b2531ed
treef556a23a0acb58530cd7041a535c0327475ada2a
parente07ea5ecbab3f5424b3818de2606302e0c21095f
Bad cast when CSS position programmatically changed from -webkit-sticky to fixed
https://bugs.webkit.org/show_bug.cgi?id=160826

Reviewed by Zalan Bujtas.
Source/WebCore:

If a scrolling state tree node changed type (e.g. from sticky to fixed), we'd fail
to recreate the node so keep a node with the wrong type.

Fix by destroying the node and making a new one with a new ID in this case. The
new ID is necessary to ensure that the scrolling tree is updated.

Test: fast/scrolling/sticky-to-fixed.html

* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeTypeAndParentMatch):
(WebCore::ScrollingStateTree::attachNode):
(WebCore::ScrollingStateTree::stateNodeForID):
* page/scrolling/ScrollingStateTree.h:

LayoutTests:

* fast/scrolling/sticky-to-fixed-expected.txt: Added.
* fast/scrolling/sticky-to-fixed.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/scrolling/sticky-to-fixed-expected.txt [new file with mode: 0644]
LayoutTests/fast/scrolling/sticky-to-fixed.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/ScrollingStateTree.cpp
Source/WebCore/page/scrolling/ScrollingStateTree.h