RequestedScrollPosition shouldn't be applied after node reattach
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jun 2019 17:21:11 +0000 (17:21 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jun 2019 17:21:11 +0000 (17:21 +0000)
commit0cc308870074e053f0b3c326769146fc58fa5027
treefeedd60945b98705d32f3a3240bca882a6aa67f3
parentd740b70a790c477b9d7e9382285dd56c05c2ca2d
RequestedScrollPosition shouldn't be applied after node reattach
https://bugs.webkit.org/show_bug.cgi?id=198994
<rdar://problem/51439685>

Reviewed by Simon Fraser.

Source/WebCore:

Test: scrollingcoordinator/ios/scroll-position-after-reattach.html

If a scrolling node gets reattached, its scroll position resets to (0,0) or whatever the previous
requestedScrollPosition was, and the current position is lost.

* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateFixedNode::setAllPropertiesChanged): Deleted.

Rename to better reflect what this is for.

* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateFrameHostingNode.cpp:
(WebCore::ScrollingStateFrameHostingNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStateFrameHostingNode.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStatePositionedNode.cpp:
(WebCore::ScrollingStatePositionedNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStatePositionedNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):

Don't set RequestedScrollPosition. It is a special property that is applied only once on request
and shouldn't get reapplied. Nodes should keep their existing scroll position on reattach.

(WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateStickyNode::setAllPropertiesChanged): Deleted.
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeWasReattachedRecursive):

LayoutTests:

* scrollingcoordinator/ios/scroll-position-after-reattach-expected.html: Added.
* scrollingcoordinator/ios/scroll-position-after-reattach.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/scrollingcoordinator/ios/scroll-position-after-reattach-expected.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/scroll-position-after-reattach.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp
Source/WebCore/page/scrolling/ScrollingStateFixedNode.h
Source/WebCore/page/scrolling/ScrollingStateFrameHostingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateFrameHostingNode.h
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h
Source/WebCore/page/scrolling/ScrollingStateNode.cpp
Source/WebCore/page/scrolling/ScrollingStateNode.h
Source/WebCore/page/scrolling/ScrollingStatePositionedNode.cpp
Source/WebCore/page/scrolling/ScrollingStatePositionedNode.h
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp
Source/WebCore/page/scrolling/ScrollingStateStickyNode.h
Source/WebCore/page/scrolling/ScrollingStateTree.cpp