Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intent to ship: Implement :-moz-any() as an alias of :is()

106 views
Skip to first unread message

Emilio Cobos Álvarez

unread,
Sep 19, 2020, 11:36:57 AM9/19/20
to dev-pl...@lists.mozilla.org
Summary: Implement the legacy :-moz-any selector as an alias of :is().

This means that it'll be more powerful, and also simpler to maintain for us.

This has been enabled in 81 beta/nightly and for the whole 82 cycle with
no regriessions so far, see bug 561154.

This means that it will accept more selectors (like :is() does), which I
don't expect to be problematic.

It also means that specificity may change in some cases, because the
specificity of :-moz-any doesn't account for the inner selectors. This
was a long-standing issue that this change fixes (bug 561154), but that
can technically change behavior (thus the pref, and having it enabled on
Nightly / Early beta for a while).

This last bit is pretty hard to use-count, because the specificity
change in most cases won't end up resulting in an actual behavior
change. I expect this to not be problematic either, because of the
limited usage that this prefixed pseudo-class has, and because behavior
is closer to what authors expect. As a data point, this change required
no changes to the browser UI at all, which extensively used the
:-moz-any() pseudo-class.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1666086

Standard: N/A, this is a legacy, prefixed pseudo-class, which we'll
build on top of the standard alternative that we've shipped for a while.

Platform coverage: All

Preference: layout.css.moz-any-is-is.enabled

DevTools bug: N/A, devtools will work the same as they work with :is().

Other browsers: N/A, this is a -moz- prefixed pseudo-class.

web-platform-tests: There are tons of tests for :is(), but I don't plan
to test the :-moz- prefixed pseudo-class in WPT.

Cheers,

-- Emilio

Tom Ritter

unread,
Sep 21, 2020, 9:47:08 AM9/21/20
to Emilio Cobos Álvarez, Mozilla
I imagine there's a good reason; but I'm curious: why do we want to
keep this legacy, prefixed pseudo-class and not just use is()?

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

Emilio Cobos Álvarez

unread,
Sep 21, 2020, 12:10:01 PM9/21/20
to Tom Ritter, Mozilla
On 9/21/20 3:46 PM, Tom Ritter wrote:
> I imagine there's a good reason; but I'm curious: why do we want to
> keep this legacy, prefixed pseudo-class and not just use is()?

Removing it is generally much more risky than aliasing to something that
is more permissive. This is specially true when accounting for
add-ons/userChrome.css users, but even without accounting for those, I
suspect :-moz-any can be used in the wild much like @-moz-document to
write Firefox-only CSS, which is a compat thing that we need to live with.

That being said, I could certainly look into it as a follow-up. Once
:-moz-any usage is removed from the codebase (there's a patch under
review) I can add a use counter and see how often it's hit on content,
to consider removing it eventually if feasible.

-- Emilio
0 new messages