Backed out changeset 5197801f499d (bug 1848639) for causing multiple build bustages related to "zoom". CLOSED TREE

This commit is contained in:
Iulian Moraru committed 2023-08-14 18:40:30 +03:00
1 parent 87d559ba36
commit 1388006304
7 files changed
+109

No files matched your search

+4
View File
@@ -152,6 +152,10 @@ fails == translate-rounding-3.html translate-rounding-viewport-ref.html # bug 13
pref(layout.css.individual-transform.enabled,true) == animate-layer-scale-inherit-4.html animate-layer-scale-inherit-4-ref.html
fuzzy-if(winWidget,0-1,0-1000) == 1569215-1.html 1569215-1-ref.html
test-pref(layout.css.zoom-transform-hack.enabled,true) == zoom-hack-1.html zoom-hack-ref.html
test-pref(layout.css.zoom-transform-hack.enabled,false) != zoom-hack-1.html zoom-hack-ref.html
test-pref(layout.css.zoom-transform-hack.enabled,true) == zoom-hack-2.html zoom-hack-ref.html
== transform-anon-block-1.html transform-anon-block-1-ref.html
test-pref(layout.animation.prerender.partial.jank,true) test-pref(layout.animation.prerender.partial,true) == partial-prerender-expansion-translate.html partial-prerender-expansion-ref.html
test-pref(layout.animation.prerender.partial,true) == partial-prerender-translate-1.html about:blank
@@ -0,0 +1,10 @@
<!doctype html>
<style>
div {
width: 100px;
height: 100px;
background: green;
zoom: 2;
}
</style>
<div></div>
@@ -0,0 +1,10 @@
<!doctype html>
<style>
div {
width: 200px;
height: 200px;
background: green;
zoom: 0;
}
</style>
<div></div>
@@ -0,0 +1,9 @@
<!doctype html>
<style>
div {
width: 200px;
height: 200px;
background: green;
}
</style>
<div></div>
+12
View File
@@ -13674,6 +13674,18 @@ if (IsCSSPropertyPrefEnabled("layout.css.backdrop-filter.enabled")) {
};
}
if (IsCSSPropertyPrefEnabled("layout.css.zoom-transform-hack.enabled")) {
gCSSProperties["zoom"] = {
domProp: "zoom",
inherited: false,
type: CSS_TYPE_LEGACY_SHORTHAND,
subproperties: ["transform", "transform-origin"],
initial_values: ["normal", "1.0", "0", "0%", "100%"],
other_values: ["10%", "2", "2.5"],
invalid_values: ["0 0", "foo", "10px"],
};
}
if (IsCSSPropertyPrefEnabled("layout.css.math-depth.enabled")) {
gCSSProperties["math-depth"] = {
domProp: "mathDepth",
+7
View File
@@ -8184,6 +8184,13 @@
value: true
mirror: always
# Make `zoom` a `transform` + `transform-origin` alias.
- name: layout.css.zoom-transform-hack.enabled
type: RelaxedAtomicBool
value: false
mirror: always
rust: true
# Whether the `-moz-control-character-visibility` property is exposed to
# content.
#
@@ -252,3 +252,60 @@ ${helpers.two_properties_shorthand(
}
}
</%helpers:shorthand>
<%helpers:shorthand name="zoom" engines="gecko"
sub_properties="transform transform-origin"
gecko_pref="layout.css.zoom-transform-hack.enabled"
flags="SHORTHAND_IN_GETCS IS_LEGACY_SHORTHAND"
spec="Not a standard, only a compat hack">
use crate::parser::Parse;
use crate::values::specified::{Number, NumberOrPercentage, TransformOrigin};
use crate::values::generics::transform::{Transform, TransformOperation};
pub fn parse_value<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Longhands, ParseError<'i>> {
let zoom = match input.try_parse(|input| NumberOrPercentage::parse(context, input)) {
Ok(number_or_percent) => number_or_percent.to_number(),
Err(..) => {
input.expect_ident_matching("normal")?;
Number::new(1.0)
},
};
// Make sure that the initial value matches the values for the
// 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.
//
// [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(),
}
} else {
expanded! {
transform: Transform(vec![TransformOperation::Scale(zoom, zoom)].into()),
transform_origin: TransformOrigin::zero_zero(),
}
})
}
impl<'a> ToCss for LonghandsToSerialize<'a> {
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write {
if self.transform.0.is_empty() && *self.transform_origin == TransformOrigin::initial_value() {
return 1.0f32.to_css(dest);
}
if *self.transform_origin != TransformOrigin::zero_zero() {
return Ok(())
}
match &*self.transform.0 {
[TransformOperation::Scale(x, y)] if x == y => x.to_css(dest),
_ => Ok(()),
}
}
}
</%helpers:shorthand>