Intent to Ship: CSS zoom property, Element.currentCSSZoom (and partially unship -moz-transform)

Skip to first unread message

Emilio Cobos Álvarez

Apr 2, 2024, 6:40:36 AMApr 2
See previous intent to prototype thread here:

Soon (as soon as the patch is reviewed), I intend to turn the CSS zoom
property on by default on all platform, and turn -moz-transform off.

This has been the current state on nightly for quite a while (3 or four
cycles at least).

Standard: (CSSWG)

Other browsers: This is one of the biggest web compat issues we have
historically. Both Blink and WebKit support this (except for the new IDL
property). Blink has an implementation of the new spec, including the
IDL property too (unsure of when it'll ship, hopefully soon).

Aside: Big thanks to the Web Compat team and Simon Pieters for all their
help both analyzing the different paths forward here, and mitigating the
compat issues, and also to the CSSWG (and Chris Harrelson in particular)
for helping getting this standardized and changing existing
implementations to be more sensible.

A bit more technical detail on what we're shipping and what we're not
shipping follows...

We are shipping the new, agreed upon standard, with the more sensible
unzooming behavior for the CSSOM discussed in the CSSWG, with one
exception: Zoom changes only affect inherited font-size (and not all
other inherited lengths). This matches what other browsers ship. I want
to implement the new behavior, but it has other performance /
correctness implications, so it might take a little bit more to evaluate
impact, and I don't think we should block zoom on that.

In order to ship the zoom property, we need to remove -moz-transform
from stylesheets, because sites would do:

-moz-transform: scale(0.5);
-moz-transform-origin: 0 0;
zoom: 0.5;

In order to get "zoom" working on both IE/WebKit/Blink and Firefox.

However, removing -moz-transform whole-sale from script is not possible,
because it breaks tons of sites which effectively do:

if (userAgent is Firefox) use "MozTransform";

See bug 1865332 and duplicates for examples of this, which include some
high-profile sites like Google itself (sad).

This setup is... not ideal, and we might tweak this in the future a
little bit, see the discussion in bug 1879746, but it seems the current
compat fallout from -moz-transform removal is acceptable, and we can let
the current state of things ride the trains and experiment on nightly
with other improvements that cause less fallout if/as needed.

Let me know if there's any concern with proceeding here.

Thanks a lot,

-- Emilio
Reply all
Reply to author
0 new messages