Summary: Allow invalid selectors inside :is() and :where() to be ignored, rather than making the whole selector list invalid.

This would allow to have some sort of escape hatch for the usual footgun of "one invalid selector in the list makes the whole style rule invalid", which is generally considered a mistake <https://wiki.csswg.org/ideas/mistakes>.

This is technically a breaking change, see below for the position of other engines on this (though these pseudo-classes are relatively recent, and we're being more permissive). The intention is to enable the pref on Nightly and Early Beta for now. You'll hear from me when enabling it everywhere :)

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1664718 <https://bugzilla.mozilla.org/show_bug.cgi?id=1664718>

Standard: This implements the resolution for csswg-drafts#3264 <https://github.com/w3c/csswg-drafts/issues/3264>. The spec is yet to be edited to reflect it.

Platform coverage: All

Preference: layout.css.is-and-where-better-error-recovery.enabled

DevTools bug: I'm not sure if it is necessary to have a devtools bug for this. The selector will serialize as :is(div) rather than :is(div, :nonsense), for example. Other than that, devtools should just work. If folks feel strongly otherwise, please file a bug and cc me on it and I'll take a look, maybe some more work could be done to surface this better in DevTools, though it wouldn't be trivial right now to expose it via the regular CSS parse error reporting mechanism (because parsing will, in fact, succeed).

Other browsers: Both Blink and Apple engineers have expressed support for this. Blink still doesn't implement these selectors, Apple engineers said on the call that they'd follow Gecko if we make the change.

web-platform-tests: Tests for this are added in the bug.

 -- Emilio

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to