Re: [csswg-drafts] [selectors-4] Disallow pseudo-elements inside :has() (#7463)

The CSS Working Group just discussed `disallowing pseudos in :has()`, and agreed to the following:

* `RESOLVED: Disallow all current pseudo-elements inside of :has(), allow future pseudo-elements to define that they are valid if useful/possible.`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: disallowing pseudos in :has()<br>
&lt;TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/7463<br>
&lt;TabAtkins> fantasai: Proposal was to make selector invalid if a pseudo-element is inside of :has()<br>
&lt;emilio> +1<br>
&lt;fantasai> TabAtkins: object to that as a general thing, because the reason we were doing that was because of conditional pseudo-elements (conditional on propeties)<br>
&lt;fantasai> TabAtkins: but shared element transitions has use case for checking existance of pseudos<br>
&lt;fantasai> TabAtkins: much more awkward API if we don't have ability<br>
&lt;fantasai> TabAtkins: outside of that, I think we should make a list of pseudo-elements that are allowed, and disallow the rest<br>
&lt;fantasai> TabAtkins: so the shared element transition ones, and just because they don't have an effect (because they exist at all times), ::marker/before/after<br>
&lt;fantasai> TabAtkins: but I can go either way on that<br>
&lt;fantasai> TabAtkins: wouldn't do anything<br>
&lt;fantasai> TabAtkins: but need a list for those that don't create cycles<br>
&lt;TabAtkins> fantasai: Prefer to make things invalid rather than valid but meaningless<br>
&lt;TabAtkins> fantasai: If we need to have exception for SET pseudos, fine, but since most pseudos won't make sense we shoudl disallow all others.<br>
&lt;TabAtkins> fantasai: Can alway smake them valid later, less likely to cause problems that way<br>
&lt;astearns> ack dbaron<br>
&lt;TabAtkins> dbaron: I agree with "list of the ones taht work"<br>
&lt;TabAtkins> dbaron: Skeptical about putting before/after/marker on that list.<br>
&lt;TabAtkins> dbaron: Not sure the statement they always exist makes sense.<br>
&lt;TabAtkins> dbaron: Do before and after exist on replaced elements? Does marker exist on non-list items?<br>
&lt;TabAtkins> dbaron: I think the spec says yes to that last one, which I find confusing.<br>
&lt;bramus> `::backdrop` might also be a handy one to allow, could unblock `:top-layer` as that would become `:has(::backdrop)`<br>
&lt;fantasai> bramus, that's just weird<br>
&lt;TabAtkins> TabAtkins: Fine with just disallowing before/after/marker<br>
&lt;faceless> Aren't they all defined to not exist on items with display:none?<br>
&lt;dbaron> s/I think the spec says yes/Not sure what the spec says/<br>
&lt;TabAtkins> astearns: Do we have the allowlist or blocklist?<br>
&lt;TabAtkins> fantasai: Proposal is an allowlist, assume invalid otherwise<br>
&lt;TabAtkins> astearns: What's the allowlist?<br>
&lt;TabAtkins> fantasai: The SET pseudos<br>
&lt;TabAtkins> astearns: what about bramus' suggestion about ::backdrop?<br>
&lt;TabAtkins> fantasai: I think it's a little weird. Not really needed, should do that as a :top-level instead.<br>
&lt;vmpstr> ntim:<br>
&lt;TabAtkins> ???: "Does ::backdrop exist?" is also not clear<br>
&lt;TabAtkins> ntim: Still think it's weird if the state can change<br>
&lt;TabAtkins> astearns: So seems the proposed resolution is that all current pseudo-elements in :has() are invalid, but allow for future pseudo-elements to define that they work<br>
&lt;chris> That sounds good to me<br>
&lt;TabAtkins> ntim: What does "invalid" mean?<br>
&lt;TabAtkins> TabAtkins: Means "invalid" - the selector inside of :has() is dropped.<br>
&lt;TabAtkins> astearns: Objections?<br>
&lt;TabAtkins> RESOLVED: Disallow all current pseudo-elements inside of :has(), allow future pseudo-elements to define that they are valid if useful/possible.<br>
&lt;chris> q+<br>
</details>


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


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

Received on Wednesday, 27 July 2022 16:20:21 UTC