[csswg-drafts] [css-anchor-position-1] Clarification on pseudo elements having originating element as implicit anchor (#12636)

vmpstr has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-anchor-position-1] Clarification on pseudo elements having originating element as implicit anchor ==
In [Implicit Anchor Elements](https://drafts.csswg.org/css-anchor-position-1/#implicit) it says

> ...
> The [implicit anchor element](https://drafts.csswg.org/css-anchor-position-1/#implicit-anchor-element) of a [pseudo-element](https://drafts.csswg.org/selectors-4/#pseudo-element) is its [originating element](https://drafts.csswg.org/selectors-4/#originating-element), unless otherwise specified.

[Finding an Anchor](https://drafts.csswg.org/css-anchor-position-1/#target) then says

> 1. If anchor spec was not passed, return the [default anchor element](https://drafts.csswg.org/css-anchor-position-1/#default-anchor-element) if it exists, otherwise return nothing.
> 2. If anchor spec is [auto](https://drafts.csswg.org/css-anchor-position-1/#valdef-position-anchor-auto):
>    1. If the Popover API defines an [implicit anchor element](https://drafts.csswg.org/css-anchor-position-1/#implicit-anchor-element) for query el which is an [acceptable anchor element](https://drafts.csswg.org/css-anchor-position-1/#acceptable-anchor-element) for query el, return that element.
>     2. Otherwise, return nothing.
>    
>     ...

It seems that given a pseudo element this would return its originating element in step 1 if the default anchor was auto (i.e `position-anchor: auto` and no anchor spec).

However, if the anchor spec is `auto` (step 2), then it only returns an implicit anchor for a Popover API and not for pseudo elements, so it would return nothing.

It wasn't clear to me if this is intentional or an oversight.

@tabatkins @fantasai 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12636 using your GitHub account


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

Received on Thursday, 21 August 2025 14:06:39 UTC