Re: [csswg-drafts] [css-cascade-6] Scoping the subject of a `:has()` selector (#9841)

> There is some potential for confusion as you'd have to figure out which parts of the selector are automatically in scope and which ones need `:in-scope`. But I think authors could get used to it.

I think right now the only rule is that only the _subject_ is required to be always in scope (well, and the `:scope` itself, of course), otherwise any other parts can be anywhere really.

> Do we also need something like `:out-of-scope`? Maybe not, since only the subject of the selector is required to be within scope. e.g. `html :scope` will automatically match.

I don't think there are many use cases for this, and we could do `:not(:in-scope)` if we'll need this for anything. Although, maybe it could still be useful to introduce a “negative” version, but I don't remember where we stand on this currently.

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


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

Received on Thursday, 3 July 2025 13:57:28 UTC