-
Notifications
You must be signed in to change notification settings - Fork 711
[css-values-5] What does sibling-index()/sibling-count() return if there's no element? #11232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't think we should defer to the ultimate originating element at all, see #9573 |
There is a question if it should parse at all. Some relevant cases are @media queries, @page properties, @font-face descriptors. A similar case is anchor-size(). The spec handles anchor-size() as IACVT if not used in a sizing property, but whether anchor-size() should parse at all in a non-element context like the ones mentioned above is not clear to me. Testing anchor-size() in Chrome turns out that it is valid at parse time for @page properties, but not for @font-face. Also, anchor-size() causes media queries to become general-enclosed. Additionally, there is the case for @container queries where I think the obvious behavior is that sibling-index()/count() resolves against the container element like font relative units, which should probably have a clarifying comment in the spec for container queries. |
In my opinion, this is an error in the spec. Fwiw, #10982 is a duplicate of this issue that is extended to other numeric substitution functions, which could also be extended to arbitrary substitution functions (cf. #10679 (comment)). |
Right. Thanks! |
sibling-index() (and its sibling, sibling-count()) does not seem to have defined behavior if there's no element, e.g. in a media query. What should the behavior here be? (Returning 0 would be fine by us, if you just want to pick something arbitrary.)
The text was updated successfully, but these errors were encountered: