From: simon.fraser@apple.com Date: Thu, 25 Apr 2019 00:46:23 +0000 (+0000) Subject: REGRESSION (r242132): Nested position:sticky elements move incorrectly X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=b30877825af3d5587b0733223e10e6ccba8fa480 REGRESSION (r242132): Nested position:sticky elements move incorrectly https://bugs.webkit.org/show_bug.cgi?id=197255 rdar://problem/50137744 Reviewed by Zalan Bujtas. Source/WebCore: Revert to the behavior of the code before r242132, where we looked at the direct parent scrolling tree node instead of walking up the ancestor chain to find an enclosing scrolling node. This fixes nested sticky behavior. Test: scrollingcoordinator/mac/nested-sticky.html * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: (WebCore::ScrollingTreeStickyNode::applyLayerPositions): LayoutTests: * scrollingcoordinator/mac/nested-sticky-expected.html: Added. * scrollingcoordinator/mac/nested-sticky.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244630 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 5bc7b6e..54c3303 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,14 @@ +2019-04-24 Simon Fraser + + REGRESSION (r242132): Nested position:sticky elements move incorrectly + https://bugs.webkit.org/show_bug.cgi?id=197255 + rdar://problem/50137744 + + Reviewed by Zalan Bujtas. + + * scrollingcoordinator/mac/nested-sticky-expected.html: Added. + * scrollingcoordinator/mac/nested-sticky.html: Added. + 2019-04-24 Alicia Boya García Unreviewed GTK test gardening diff --git a/LayoutTests/scrollingcoordinator/mac/nested-sticky-expected.html b/LayoutTests/scrollingcoordinator/mac/nested-sticky-expected.html new file mode 100644 index 0000000..2d1997a --- /dev/null +++ b/LayoutTests/scrollingcoordinator/mac/nested-sticky-expected.html @@ -0,0 +1,42 @@ + + + + + + + +
+
+ + diff --git a/LayoutTests/scrollingcoordinator/mac/nested-sticky.html b/LayoutTests/scrollingcoordinator/mac/nested-sticky.html new file mode 100644 index 0000000..c9d4ed2 --- /dev/null +++ b/LayoutTests/scrollingcoordinator/mac/nested-sticky.html @@ -0,0 +1,60 @@ + + + + + + + +
+
+ + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index cb4cfdd..fbe82ef 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,20 @@ +2019-04-24 Simon Fraser + + REGRESSION (r242132): Nested position:sticky elements move incorrectly + https://bugs.webkit.org/show_bug.cgi?id=197255 + rdar://problem/50137744 + + Reviewed by Zalan Bujtas. + + Revert to the behavior of the code before r242132, where we looked at the direct parent + scrolling tree node instead of walking up the ancestor chain to find an enclosing scrolling node. + This fixes nested sticky behavior. + + Test: scrollingcoordinator/mac/nested-sticky.html + + * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: + (WebCore::ScrollingTreeStickyNode::applyLayerPositions): + 2019-04-24 Eric Carlson Create AVFoundationSoftLink.{h,mm} to reduce duplicate code diff --git a/Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm b/Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm index 2727fb1..404c735 100644 --- a/Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm +++ b/Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm @@ -69,7 +69,7 @@ void ScrollingTreeStickyNode::applyLayerPositions(const FloatRect& layoutViewpor { FloatRect constrainingRect; - auto* enclosingScrollingNode = enclosingScrollingNodeIncludingSelf(); + auto* enclosingScrollingNode = parent(); if (is(enclosingScrollingNode)) constrainingRect = FloatRect(downcast(*enclosingScrollingNode).currentScrollPosition(), m_constraints.constrainingRectAtLastLayout().size()); else if (is(enclosingScrollingNode))