Re: [csswg-drafts] [css-anchor-position] Flat tree vs. anchor-scope (#10325)

Not to worry @khushalsagar and @noamr, anchor lookup is already tree-scoped in the spec, and this issue does not change that. The anchor-scope property is an _additional_ scoping mechanism that can only reduce the scope of things further. It does not change nor loosen the restrictions of tree-scoped lookups.

This issue is about exactly how to "look for" the anchor-scope-element. We either need to look at a given element's flat-tree ancestors, or the light tree ancestors. I do think we need the flat tree ancestors for this to work well, otherwise an anchor styled with ::slotted() can never be in an anchor-scope defined within the shadow root.
See https://github.com/web-platform-tests/wpt/blob/313fd03a0b/css/css-anchor-position/anchor-scope-shadow.tentative.html for an example where the distinction makes a difference.

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


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

Received on Wednesday, 3 July 2024 19:27:28 UTC