csswg-drafts icon indicating copy to clipboard operation
csswg-drafts copied to clipboard

[css-anchor-position] When does anchor-scope "match" a name?

Open andruud opened this issue 1 month ago • 0 comments

When an anchor-scope is specified with a <dashed-ident>, it scopes the name to that subtree when the anchor name is "matching". The problem is that this matching can be interpreted in at least three ways:

(Assuming that anchor-scope is a tree-scoped reference, which is also not clear in the spec):

  1. It matches by the ident part of the name only, ignoring any tree-scope that would be associated with the name, or
  2. It matches by exact match of the ident part and the associated tree-scope, or
  3. It matches by some mechanism similar to dereferencing of tree-scoped references, where it's a match when the tree-scope of the anchor-scope-name is an inclusive ancestor of the tree-scope of the anchor query.

So we need to define exactly what "matching" means. For now I've implemented (2), but it's not obvious that gives the best behavior.

andruud avatar Jul 04 '24 09:07 andruud