Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8ce3ea26b295d49e6b52b2a0473195ed3c4fef4b
https://github.com/WebKit/WebKit/commit/8ce3ea26b295d49e6b52b2a0473195ed3c4fef4b
Author: Kiet Ho <[email protected]>
Date: 2026-04-20 (Mon, 20 Apr 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/mixed-dependency-chain-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/mixed-dependency-chain.html
M Source/WebCore/style/AnchorPositionEvaluator.cpp
M Source/WebCore/style/AnchorPositionEvaluator.h
Log Message:
-----------
[css-anchor-position-1] position-area can't anchor to an element positioned
using anchor function
rdar://173964030
https://bugs.webkit.org/show_bug.cgi?id=311365
Reviewed by Antti Koivisto.
309845@main explicitly serializes the resolution of elements in a chain of
anchors
(chain of elements where one anchors to another and is also an anchor for other
elements to anchor to). But that only works when all elements uses anchor
functions.
This patch brings this to elements using layout-time anchor positioning
(position-area and anchor-center)
1) In updateAnchorPositioningStatesAfterInterleavedLayout, add a loop that
computes whether
all anchor dependencies of an anchor-positioned element have been positioned
or not, and
store this result in AnchorPositionedToAnchorEntry (used by
defaultAnchorForBox)
2) In defaultAnchorForBox, only resolves the default anchor box if all anchor
dependencies
have been positioned.
This patch also centralizes state machine transition logic to be under
updateAnchorPositioningStatesAfterInterleavedLayout. Previously this logic is
scattered
around the anchor function resolution code.
Test:
imported/w3c/web-platform-tests/css/css-anchor-position/mixed-dependency-chain.html
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/mixed-dependency-chain-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/mixed-dependency-chain.html:
Added.
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::AnchorPositionEvaluator::findAnchorForAnchorFunctionAndAttemptResolution):
(WebCore::Style::AnchorPositionEvaluator::updateAnchorPositioningStatesAfterInterleavedLayout):
(WebCore::Style::AnchorPositionEvaluator::defaultAnchorForBox):
* Source/WebCore/style/AnchorPositionEvaluator.h:
Canonical link: https://commits.webkit.org/311601@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications