From a4d2beecd36054a2c9d6dfda3738e69e75ffce9e Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Sun, 29 Oct 2023 18:29:39 +0100 Subject: [PATCH] Further changes required by Servo --- components/style/values/specified/calc.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/style/values/specified/calc.rs b/components/style/values/specified/calc.rs index 75aefa78fb2..dd4ab3ab4cb 100644 --- a/components/style/values/specified/calc.rs +++ b/components/style/values/specified/calc.rs @@ -34,6 +34,13 @@ fn nan_inf_enabled() -> bool { return false; } +fn round_enabled() -> bool { + #[cfg(feature = "gecko")] + return static_prefs::pref!("layout.css.round.enabled"); + #[cfg(feature = "servo")] + return false; +} + /// The name of the mathematical function that we're parsing. #[derive(Clone, Copy, Debug, Parse)] pub enum MathFunction { @@ -772,7 +779,7 @@ impl CalcNode { let enabled = if matches!(function, Sin | Cos | Tan | Asin | Acos | Atan | Atan2) { trig_enabled() } else if matches!(function, Round) { - static_prefs::pref!("layout.css.round.enabled") + round_enabled() } else { true };