Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 44870cdd103798960511008af237e85b161bc85d
https://github.com/WebKit/WebKit/commit/44870cdd103798960511008af237e85b161bc85d
Author: Simon Fraser <[email protected]>
Date: 2026-02-09 (Mon, 09 Feb 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/page/scrolling/ScrollAnchoringController.cpp
M Source/WebCore/page/scrolling/ScrollAnchoringController.h
M Source/WebCore/rendering/LayoutScope.cpp
M Source/WebCore/rendering/RenderElement.cpp
M Source/WebCore/rendering/RenderElement.h
M Source/WebCore/style/StyleDifference.cpp
Log Message:
-----------
[Scroll anchoring] Implement the anchor suppression algorithm
rdar://169928871
https://bugs.webkit.org/show_bug.cgi?id=307284
Reviewed by Alan Baradlay.
There are three aspects to scroll anchoring suppression.
First, we check for `OverflowAnchor::None` on any object between the anchor
and the scroller (inclusive). When this property changes, we need to trigger a
re-evaluation
of anchoring which is currently done inefficiently by triggering layout, but
this will not
be common.
Second, when one of the style properties changes in the list under "suppression
triggers"[1],
we set a `scrollAnchoringSuppressionStyleChanged` bit on RenderElement and
check it in
`anchoringSuppressedByStyleChange()`; these bits are checked on any object
between
the anchor and the scroller (inclusive). They are cleared in `~LayoutScope`.
Third, when the computed value of the `position` property changes on any
element in
the scroller. We implement this by setting the bit on the scroller itself, in
`notifyChildHadSuppressingStyleChange()`.
[1] https://drafts.csswg.org/css-scroll-anchoring/#suppression-triggers
* LayoutTests/TestExpectations:
* Source/WebCore/page/scrolling/ScrollAnchoringController.cpp:
(WebCore::ScrollAnchoringController::notifyChildHadSuppressingStyleChange):
(WebCore::candidateMayMoveWithScroller):
(WebCore::ScrollAnchoringController::examinePriorityCandidate const):
(WebCore::overflowAnchorProhibitsAnchoring):
(WebCore::ScrollAnchoringController::examineAnchorCandidate const):
(WebCore::ScrollAnchoringController::anchoringSuppressedByStyleChange const):
* Source/WebCore/page/scrolling/ScrollAnchoringController.h:
* Source/WebCore/rendering/LayoutScope.cpp:
(WebCore::LayoutScope::~LayoutScope):
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
* Source/WebCore/rendering/RenderElement.h:
(WebCore::RenderElement::scrollAnchoringSuppressionStyleChanged const):
(WebCore::RenderElement::setScrollAnchoringSuppressionStyleChanged):
* Source/WebCore/style/StyleDifference.cpp:
Canonical link: https://commits.webkit.org/307141@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications