(Async scrolling) Handle 'position:fixed' inside 'position:sticky' correctly.
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jun 2019 18:27:35 +0000 (18:27 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jun 2019 18:27:35 +0000 (18:27 +0000)
commit0c609a78cb7dc9697e4c8742f4a1ab2ada535b92
tree3acc0f509153cf6ea8c84412e7ac79c492b97eac
parentd106444a3c00fba686e4c86f5ad9e0a12e4bddc3
(Async scrolling) Handle 'position:fixed' inside 'position:sticky' correctly.
https://bugs.webkit.org/show_bug.cgi?id=198788
<rdar://problem/51589759>

Reviewed by Simon Fraser.

Source/WebCore:

Handle 'position:fixed' inside 'position:sticky' correctly.

Also fix nested 'position:fixed' in case where there is an overflow scroller between them.

Tests: scrollingcoordinator/ios/fixed-inside-overflow-inside-fixed.html
       scrollingcoordinator/ios/fixed-inside-sticky-frame.html
       scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context-2.html
       scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context.html
       scrollingcoordinator/ios/fixed-inside-sticky-stacking-context.html

* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::applyLayerPositions):

Take offsets from sticky nodes into account.

* page/scrolling/cocoa/ScrollingTreeStickyNode.h:
(WebCore::ScrollingTreeStickyNode::layer):
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::computeLayerPosition const):

Factor into a function.

(WebCore::ScrollingTreeStickyNode::applyLayerPositions):
(WebCore::ScrollingTreeStickyNode::scrollDeltaSinceLastCommit const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):

We need to generate a scrolling tree node for position:fixed in nested case if there is an overflow scroller
between the layers.

LayoutTests:

* scrollingcoordinator/ios/fixed-inside-overflow-inside-fixed-expected.html: Added.
* scrollingcoordinator/ios/fixed-inside-overflow-inside-fixed.html: Added.
* scrollingcoordinator/ios/fixed-inside-sticky-frame-expected.html: Added.
* scrollingcoordinator/ios/fixed-inside-sticky-frame.html: Added.
* scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context-2-expected.html: Added.
* scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context-2.html: Added.
* scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context-expected.html: Added.
* scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context.html: Added.
* scrollingcoordinator/ios/fixed-inside-sticky-stacking-context-expected.html: Added.
* scrollingcoordinator/ios/fixed-inside-sticky-stacking-context.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246367 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/scrollingcoordinator/ios/fixed-inside-overflow-inside-fixed-expected.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/fixed-inside-overflow-inside-fixed.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/fixed-inside-sticky-frame-expected.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/fixed-inside-sticky-frame.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context-2-expected.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context-2.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context-expected.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/fixed-inside-sticky-no-stacking-context.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/fixed-inside-sticky-stacking-context-expected.html [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/fixed-inside-sticky-stacking-context.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/cocoa/ScrollingTreeFixedNode.mm
Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.h
Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm
Source/WebCore/rendering/RenderLayerCompositor.cpp