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

Chrome landed a fix that supports this behind an experimental flag. It also added the following cases to the WPT tests to clarify certain behaviors:

* Preserve empty items, with a whitespace after each comma:
  - `:is(,,,)` -> `:is(, , , )`
* Trim trailing whitespace from an invalid selector:
  - `:is(::before:HOVER  )` -> `:is(::before:HOVER)`
* Serialize an invalid complex/compound selector as-is, even when the selector is valid outside of a forgiving selector list:
  - `:host(:is(.a, .b+.c, .d))`: unchanged after serialization. (No whitespace is added around the `+` combinator, since complex selectors are invalid inside `:host()`).
  - `:is(::before:HOVER, .a)`: unchanged after serialization. (`:HOVER` is not lowercased, since the compound `::before:HOVER` is invalid. `::before` is not allowed inside `:is()`)
  - `:has(:is(:has(.a+.b)))`: unchanged after serialization. (Nested `:has()` is invalid)

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


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

Received on Thursday, 30 July 2026 02:34:15 UTC