Re: [csswg-drafts] [css-selectors] Proposal for allowing selectors that depend on layout (:stuck, :snap, :on-screen, etc) (#5979)

The elements that are in a layout dependent state, meaning those that would be matched by the layout depending selector, i.e. `:stuck`, `:snap`, `:on-screen`, etc.

Taking your example `.foo:stuck + .bar <+ .foo`.

As UAs match from right to left, this would be:
1. All elements with the class `foo`.
2. Restricted to those that have a following sibling with class `bar`.
3. Restricted to those that have a previous sibling that is stuck and has a class `foo`.
4. Restricted to those that are _not_ stuck.

So the layout depending selectors need to be remembered and the elements matching them have to be excluded in the last step. This last step is of course only needed in situations where the subject _could_ be part of the compound selectors before it. As those are presumably special cases, it wouldn't be needed in most situations.

Sebastian

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


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

Received on Monday, 22 March 2021 20:10:05 UTC