Some elements lag behind async overflow scrolling on palace-games.com
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2019 16:44:49 +0000 (16:44 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2019 16:44:49 +0000 (16:44 +0000)
commit4f56fc14f086e9083f227cd83b76d5df1af2c24d
tree319b4dedab3567f8b99c1d40f67e7d6820b7a84d
parent8091fddcb8bbdd05c2413ca3c84a6c76921ab7cd
Some elements lag behind async overflow scrolling on palace-games.com
https://bugs.webkit.org/show_bug.cgi?id=195934

Reviewed by Zalan Bujtas.
Source/WebCore:

The logic added in r242997 was wrong for an absolutely-positioned layer whose containig block was
inside an overflow:scroll, but whose compositing ancestor was outside. This is a case where
we need to make a Positioning node for the absolute layer, because it needs to move along
with the scrolled content.

There are six permutations of overflow, containing block and compositing ancestor that we care about.
Showing renderer (aka DOM) order, they are (where <- indicates child <- parent):

layer <- cb <- ca <- os -- no positioned node required
layer <- cb <- os <- ca -- compositing parent skips overflow, need a "Moved" Positioned node.
layer <- ov <- cb <- ca -- no positioned node required
layer <- ov <- ca <- cb -- no positioned node required
layer <- ca <- cb <- ov -- no positioned node required
layer <- ca <- ov <- cb -- containing block skips overflow, need a "Stationary" Positioned node.

[cb = containing block, ca = compositing ancestor, ov = overflow scroll]

Test: scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html

* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):

LayoutTests:

Add a test with more combinations of overflow, containing block and compositing ancestor.

* platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt [new file with mode: 0644]
LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt [new file with mode: 0644]
LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp