Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 89983a32335b1264bd3140d30f880d147a442912
https://github.com/WebKit/WebKit/commit/89983a32335b1264bd3140d30f880d147a442912
Author: Kiet Ho <[email protected]>
Date: 2026-03-25 (Wed, 25 Mar 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scope-display-contents.tentative-expected.txt
M Source/WebCore/dom/Element.cpp
M Source/WebCore/style/AnchorPositionEvaluator.cpp
Log Message:
-----------
[css-anchor-position-1] Element with display: contents doesn't establish an
anchor scope when using anchor-scope
rdar://172355302
https://bugs.webkit.org/show_bug.cgi?id=309239
Reviewed by Antti Koivisto.
anchorScopeForAnchorName figures out which ancestor establishes an anchor scope
covering the element. It reads the value of 'anchor-scope' property from the
style
returned by Element::renderStyle(). But renderStyle() is nullptr if the element
is display: contents. Change it to use renderOrDisplayContentsStyle() instead.
Test:
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scope-display-contents.tentative.html
*
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scope-display-contents.tentative-expected.txt:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::storeDisplayContentsOrNoneStyle):
* Source/WebCore/style/AnchorPositionEvaluator.cpp:
(WebCore::Style::anchorScopeForAnchorName):
Canonical link: https://commits.webkit.org/309946@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications