Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ce2cb07293043620ed0e8b851f50a10c4e11342d
https://github.com/WebKit/WebKit/commit/ce2cb07293043620ed0e8b851f50a10c4e11342d
Author: Elika Etemad <[email protected]>
Date: 2026-06-08 (Mon, 08 Jun 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-fixedpos-nested-001-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-fixedpos-nested-001.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-fixedpos-nested-002-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-fixedpos-nested-002.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/reference/anchor-scroll-fixedpos-nested-001-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/reference/anchor-scroll-fixedpos-nested-002-ref.html
M Source/WebCore/page/LocalFrameViewLayoutContext.cpp
M Source/WebCore/page/LocalFrameViewLayoutContext.h
M Source/WebCore/rendering/RenderLayer.h
M Source/WebCore/rendering/RenderLayerCompositor.cpp
M Source/WebCore/style/AnchorPositionEvaluator.cpp
M Source/WebCore/style/AnchorPositionEvaluator.h
Log Message:
-----------
Fix scroll overcompensation of fixed anchor-positioned elements when nested
https://bugs.webkit.org/show_bug.cgi?id=310888
rdar://174010503
Reviewed by Simon Fraser.
Because the transform we use to compensate for scrolling affects descendants
(including out-of-flow descendants), a fixedpos anchored box inside another
fixedpos box currently double-compensates for scrolling.
This patch introduces an unwind() method to the AnchorScrollAdjuster so that
it can avoid duplicating the scroll compensation of its parent.
It also tags such boxes by setting a zeroed anchorScrollAdjustment on them even
if their AnchorScrollAdjuster is fully empty, so that the compositing code knows
that (unlike regular fixedpos elements) they can be scrolled into view.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-fixedpos-nested-001-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-fixedpos-nested-001.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-fixedpos-nested-002-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-fixedpos-nested-002.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/reference/anchor-scroll-fixedpos-nested-001-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/reference/anchor-scroll-fixedpos-nested-002-ref.html:
Added.
* Source/WebCore/page/LocalFrameViewLayoutContext.cpp:
(WebCore::LocalFrameViewLayoutContext::unregisterAnchorScrollAdjusterFor):
* Source/WebCore/page/LocalFrameViewLayoutContext.h:
* Source/WebCore/rendering/RenderLayer.h:
Allow maintaining an anchorScrollAdjustment even if there is no
anchorScrollAdjuster
(to identify cases where the scroll adjustment is managed by an ancestor).
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
Maintain compositing of scroll-adjusted fixedpos boxes, even if they're
offscreen.
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::AnchorScrollAdjuster::removeMatchingSnapshots):
(WebCore::Style::clearAnchorScrollSnapshots):
(WebCore::Style::AnchorPositionEvaluator::captureScrollSnapshots):
* Source/WebCore/style/AnchorPositionEvaluator.h:
Unwind scroll adjustments already performed by our ancestor.
Canonical link: https://commits.webkit.org/314757@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications