From 9c1dd4b3ead24cbaecb6650ee509d167c74b0d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 6 Nov 2019 05:54:17 +0000 Subject: [PATCH] style: Make zoom: 0 mean the same as zoom: 1. This matches the WebKit implementation, and is clearly a violation of the rules we generally use for ranges in CSS. But it seems to be depended-on legacy behavior, see the linked WebKit bug, this bug, and bug 1593317. Differential Revision: https://phabricator.services.mozilla.com/D51539 --- components/style/properties/shorthands/box.mako.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/style/properties/shorthands/box.mako.rs b/components/style/properties/shorthands/box.mako.rs index 7b4ce131922..351b8cec606 100644 --- a/components/style/properties/shorthands/box.mako.rs +++ b/components/style/properties/shorthands/box.mako.rs @@ -464,11 +464,13 @@ ${helpers.two_properties_shorthand( }; // Make sure that the initial value matches the values for the - // longhands, just for general sanity. + // longhands, just for general sanity. `zoom: 1` and `zoom: 0` are + // ignored, see [1][2]. They are just hack for the "has layout" mode on + // IE. // - // FIXME: Should we just do this for the "normal" case? Seems weird - // either way, so maybe not? - Ok(if zoom.get() == 1.0 { + // [1]: https://bugs.webkit.org/show_bug.cgi?id=18467 + // [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1593009 + Ok(if zoom.get() == 1.0 || zoom.get() == 0.0 { expanded! { transform: Transform::none(), transform_origin: TransformOrigin::initial_value(),