Re: [csswg-drafts] [selectors] Is it intentional that :has(:is()) is different from :has()? (#9422)

The behavior listed here *is* basically intentional; both features are working as intended. `:has()`'s argument is forced to be relative, so `#outer` must be a descendant of `#middle` (and it isn't), while `:is()`'s argument is specifically *not* relative, so `#outer` can be further up the tree.

You'll get this same behavior from, say, @scope: in `@scope #middle { #outer #inner {...} :is(#outer #inner) {...}}` the first won't match (it's relative-by-default, since there's no `:scope` or `&` in the selector) but the second will.

Could you elaborate on what you see as the problem with Nesting?

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


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

Received on Thursday, 28 September 2023 19:42:02 UTC