Re: [csswg-drafts] [selectors] Should :not(foo) match the host of the shadow tree? (#10179)

The CSS Working Group just discussed `[selectors] Should :not(foo) match the host of the shadow tree?`, and agreed to the following:

* `RESOLVED: edit in what's described in Tabs last comment`

<details><summary>The full IRC log of that discussion</summary>
&lt;RRSAgent> I have made the request to generate https://www.w3.org/2024/08/14-css-minutes.html fantasai<br>
&lt;keithamus> TabAtkins: a q raised: what the `:not` pseudo class means wrt the `:host` element. The point of it being featureless is to avoid having to defensively think about what the outer page is doing with the host element<br>
&lt;keithamus> ... should :not match everything but the host by default?<br>
&lt;keithamus> ... not should, by default, not match the host element by default. Just like .foo wouldn't match, not(.foo) wouldn't.<br>
&lt;keithamus> ... if you explicitly mention the host in the :not, you're explicitly opting in, so there could be a small set of rules for :not matching, compound selectors matching, complex selectors are allowed to match only if the subject compound is allowed to match<br>
&lt;keithamus> ... this captures the notion of if the :not selector is caring about the host element. If so it is allowed to match otherwise it ignores like everything else.<br>
&lt;keithamus> ... if this sounds reasonable I can write the edits<br>
&lt;emilio> q+<br>
&lt;astearns> ack emilio<br>
&lt;keithamus> ... I believe that brings all logical combinator pseudos into a reasonable state wrt the host eleemnt<br>
&lt;keithamus> emilio: the only selector that would matter would be :not(:host)? Other stuff would never match effectively?<br>
&lt;keithamus> TabAtkins: I believe so<br>
&lt;keithamus> emilio: can we make this simpler and say it never matches? Given :host is featureless<br>
&lt;keithamus> ... is there a use case for :not(:host)?<br>
&lt;keithamus> TabAtkins: there are other things that could do that. Also :has(). You could potentially match a host element without :host, and if you :not that, you could potentially match the host...<br>
&lt;keithamus> ... example:<br>
&lt;TabAtkins> if :has(.foo) doesn't match the host (but is allowed to), the :not(:has(.foo)) would match the host<br>
&lt;keithamus> emilio: do you really want :not(:has(.foo)) to really match?<br>
&lt;keithamus> TabAtkins: that's the next issue<br>
&lt;keithamus> emilio: I thought the next issue was :host(:has work<br>
&lt;keithamus> emilio: I think I see, it's very weird. In general I dont think you can match the host with something which doesn't contain :host<br>
&lt;keithamus> TabAtkins: that's the next issue<br>
&lt;keithamus> astearns: Could we move forward with the complicated bits and drop them if we dont need them?<br>
&lt;keithamus> TabAtkins: a selector X that's potentially able to match a set of elements, X and :not(X) should match all elements, which may or may not include the host.<br>
&lt;keithamus> ... that's the underpinning I want to resolve on<br>
&lt;TabAtkins> s/match all elements/match all those potential elements/<br>
&lt;keithamus> PROPOSED RESOLUTION: edit in what's described in Tabs last comment<br>
&lt;keithamus> RESOLVED: edit in what's described in Tabs last comment<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10179#issuecomment-2289301689 using your GitHub account


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

Received on Wednesday, 14 August 2024 16:49:43 UTC