[iOS WK2] Wrong scrolling behavior for nested absolute position elements inside overf...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2019 14:54:12 +0000 (14:54 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2019 14:54:12 +0000 (14:54 +0000)
commit1f23637261f81051815c4844d51a6cfb2c224a70
tree3ea6fc5a5a8004d6126140041f9435e970d390ec
parent51c123de1cc235bac7232487e22334a87c0c80d3
[iOS WK2] Wrong scrolling behavior for nested absolute position elements inside overflow scroll
https://bugs.webkit.org/show_bug.cgi?id=196146

Reviewed by Antti Koivisto.

Source/WebCore:

computeCoordinatedPositioningForLayer() failed to handle nested positions elements
inside overflow scroll, because it only walked up to the first containing block of
a nested position:absolute. We need to walk all the way up the ancestor layer chain,
looking at containing block, scroller and composited ancestor relationships.

Make this code easier to understand by writing it in terms of "is foo scrolled by bar", rather than
trying to collapse all the logic into a single ancestor walk, which was really hard. This is a few
more ancestor traversals, but we now only run this code if there's composited scrolling
in the ancestor chain.

Tests: scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html
       scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html
       scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html
       scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::enclosingCompositedScrollingLayer):
(WebCore::isScrolledByOverflowScrollLayer):
(WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor):
(WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
(WebCore::collectStationaryLayerRelatedOverflowNodes):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
(WebCore::collectRelatedCoordinatedScrollingNodes):
(WebCore::layerParentedAcrossCoordinatedScrollingBoundary): Deleted.

LayoutTests:

Dump the scrolling tree for various configurations of positioned, overflow and stacking context
elements.

* fast/scrolling/ios/overflow-scroll-overlap-6-expected.txt: Progressed results.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt: Added.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow-expected.txt: Added.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt: Added.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-6-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt [new file with mode: 0644]
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt [new file with mode: 0644]
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow-expected.txt [new file with mode: 0644]
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt [new file with mode: 0644]
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt [new file with mode: 0644]
LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp