Re: [csswg-drafts] [css-anchor-position-1] Clarify how anchor-scope works with display:contents (#12783)

`display: contents` prevents that element from generating any box, so I imagine it wouldn't have any principal box.
`anchor-name` is [applies to](https://drafts.csswg.org/css-anchor-position-1/#name) for all elements generating a principal box.
OTOH `anchor-scope` [applies to](https://drafts.csswg.org/css-anchor-position-1/#anchor-scope) all elements. 

Strictly from above, I'd expect `display: contents` to have no impact on the behaviour of `anchor-scope`.
Both Chrome Canary (142.0.7401.0) and Safari TP (225, WebKit 20623.1.1.1) seem to ignore `anchor-scope: all` if we add  `display; contents` to that element.

Implementation-wise, I think this means that, for `anchor-scope` specifically, we need DOM tree traversal, whereas we could get away with box tree traversal otherwise.

-- 
GitHub Notification of comment by dshin-moz
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12783#issuecomment-3280974642 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 11 September 2025 14:11:32 UTC