Re: [csswg-drafts] [selectors] consider preserving invalid selectors in :is() and :where() (#8356)

The CSS Working Group just discussed `[selectors] consider preserving invalid selectors in :is() and :where()`, and agreed to the following:

* `RESOLVED: preserve invalid selectors inside forgiving selector lists (such as :is() and :where()) regardless of whether there's an & in them`

<details><summary>The full IRC log of that discussion</summary>
&lt;dbaron> emilio: For nesting, when you have an &amp; in a nested selector, we resolved to preserve the invalid selector inside so that you could properly track whether there was an &amp;.  Makes sense.  But inconsistent, in the sense that it's a weird special case.  Would be more consistent IMO to preserve all invalid selectors.  That way you don't special case nesting.  It's also more consistent with @supports and @media, with &lt;general-enclosed>.<br>
&lt;dbaron> emilio: ... It feels more generally consistent.  I don't think it matters particularly... I don't expect compat issues.  The question is... as Oriol mentioned, this also makes the empty selector kind of silly.<br>
&lt;dbaron> TabAtkins: As a selectors editor, I agree, would be good to keep it ??? defined.<br>
&lt;dbaron> TabAtkins: not sure why we decided to drop the invalid selector arguments in :is()<br>
&lt;dbaron> emilio: implementation-wise, it's easier to just drop it, but if we need to preserve it, easier to preserve always rather than sometimes.<br>
&lt;ntim_> q+<br>
&lt;dbaron> emilio: So if nobody objects I think this would be better than the current specified behavior.<br>
&lt;bramus> +1<br>
&lt;Rossen_> ack ntim_<br>
&lt;dbaron> ntim_: Isn't there something about forgiving parsing?<br>
&lt;dbaron> emilio: That's the behavior of dropping invalid selector.<br>
&lt;dbaron> TabAtkins: nesting cares about whether there's an &amp; at all, so you don't have a newer/older browser behavior switch.<br>
&lt;bramus> dbaron: so you would still be treating invalid selectors the same<br>
&lt;dbaron> dbaron: ... just preserving them in the OM.<br>
&lt;bramus> … but just not drop m<br>
&lt;dbaron> TabAtkins: yes<br>
&lt;dbaron> emilio: Proposed resolution: preserve invalid selectors inside :is() and :where() regardless of whether there's an &amp; token.<br>
&lt;dbaron> ?: do for all forgiving selector lists?<br>
&lt;astearns> s/?/matthieudubet<br>
&lt;dbaron> TabAtkins: I think that's all of them for now, but we should say for all forgiving selector lists.<br>
&lt;dbaron> RESOLVED: preserve invalid selectors inside forgiving selector lists (such as :is() and :where()) regardless of whether there's an &amp; in them<br>
</details>


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


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

Received on Wednesday, 19 July 2023 22:22:08 UTC