From 8d75a376ce2b4544112e7eb69d52466d3de76adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Thu, 29 Feb 2024 16:37:40 +0000 Subject: [PATCH] Bug 1882144 - Remove layout.css.math-style.enabled and layout.css.math-depth.enabled prefs. r=layout-reviewers,emilio Differential Revision: https://phabricator.services.mozilla.com/D202940 --- .../test/static/browser_parsable_css.js | 18 ------- layout/style/test/property_database.js | 54 +++++++++---------- modules/libpref/init/StaticPrefList.yaml | 14 ----- .../style/properties/longhands/font.mako.rs | 6 --- .../components/style/values/specified/font.rs | 14 +---- 5 files changed, 27 insertions(+), 79 deletions(-) diff --git a/browser/base/content/test/static/browser_parsable_css.js b/browser/base/content/test/static/browser_parsable_css.js index b34ae7d9c19c..602cc5a7e2db 100644 --- a/browser/base/content/test/static/browser_parsable_css.js +++ b/browser/base/content/test/static/browser_parsable_css.js @@ -68,24 +68,6 @@ if (!Services.prefs.getBoolPref("layout.css.zoom.enabled")) { }); } -if (!Services.prefs.getBoolPref("layout.css.math-depth.enabled")) { - // mathml.css UA sheet rule for math-depth. - ignoreList.push({ - sourceName: /\b(scrollbars|mathml)\.css$/i, - errorMessage: /Unknown property .*\bmath-depth\b/i, - isFromDevTools: false, - }); -} - -if (!Services.prefs.getBoolPref("layout.css.math-style.enabled")) { - // mathml.css UA sheet rule for math-style. - ignoreList.push({ - sourceName: /(?:res|gre-resources)\/mathml\.css$/i, - errorMessage: /Unknown property .*\bmath-style\b/i, - isFromDevTools: false, - }); -} - if (!Services.prefs.getBoolPref("layout.css.scroll-anchoring.enabled")) { ignoreList.push({ sourceName: /webconsole\.css$/i, diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 24b9762ca4ce..2e8b4c71a30f 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -13604,36 +13604,32 @@ if (IsCSSPropertyPrefEnabled("layout.css.backdrop-filter.enabled")) { }; } -if (IsCSSPropertyPrefEnabled("layout.css.math-depth.enabled")) { - gCSSProperties["math-depth"] = { - domProp: "mathDepth", - inherited: true, - type: CSS_TYPE_LONGHAND, - initial_values: ["0"], - other_values: [ - // auto-add cannot be tested here because it has no effect when the - // inherited math-style is equal to the default (normal). - "123", - "-123", - "add(123)", - "add(-123)", - "calc(1 + 2*3)", - "add(calc(4 - 2/3))", - ], - invalid_values: ["auto", "1,23", "1.23", "add(1,23)", "add(1.23)"], - }; -} +gCSSProperties["math-depth"] = { + domProp: "mathDepth", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: [ + // auto-add cannot be tested here because it has no effect when the + // inherited math-style is equal to the default (normal). + "123", + "-123", + "add(123)", + "add(-123)", + "calc(1 + 2*3)", + "add(calc(4 - 2/3))", + ], + invalid_values: ["auto", "1,23", "1.23", "add(1,23)", "add(1.23)"], +}; -if (IsCSSPropertyPrefEnabled("layout.css.math-style.enabled")) { - gCSSProperties["math-style"] = { - domProp: "mathStyle", - inherited: true, - type: CSS_TYPE_LONGHAND, - initial_values: ["normal"], - other_values: ["compact"], - invalid_values: [], - }; -} +gCSSProperties["math-style"] = { + domProp: "mathStyle", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: ["compact"], + invalid_values: [], +}; if (IsCSSPropertyPrefEnabled("layout.css.forced-color-adjust.enabled")) { gCSSProperties["forced-color-adjust"] = { diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 854eaca31982..61120e1f3f0f 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -8644,20 +8644,6 @@ mirror: always rust: true -# Is support for math-style enabled? -- name: layout.css.math-style.enabled - type: RelaxedAtomicBool - value: true - mirror: always - rust: true - -# Is support for math-depth enabled? -- name: layout.css.math-depth.enabled - type: RelaxedAtomicBool - value: true - mirror: always - rust: true - # Is -moz-osx-font-smoothing enabled? (Only supported in OSX builds) - name: layout.css.osx-font-smoothing.enabled type: bool diff --git a/servo/components/style/properties/longhands/font.mako.rs b/servo/components/style/properties/longhands/font.mako.rs index f188af5b1f39..4583de0bd740 100644 --- a/servo/components/style/properties/longhands/font.mako.rs +++ b/servo/components/style/properties/longhands/font.mako.rs @@ -305,10 +305,7 @@ ${helpers.predefined_type( "MathDepth", "0", engines="gecko", - gecko_pref="layout.css.math-depth.enabled", - has_effect_on_gecko_scrollbars=False, animation_value_type="none", - enabled_in="ua", spec="https://mathml-refresh.github.io/mathml-core/#the-math-script-level-property", affects="", )} @@ -318,11 +315,8 @@ ${helpers.single_keyword( "normal compact", engines="gecko", gecko_enum_prefix="StyleMathStyle", - gecko_pref="layout.css.math-style.enabled", spec="https://mathml-refresh.github.io/mathml-core/#the-math-style-property", - has_effect_on_gecko_scrollbars=False, animation_value_type="none", - enabled_in="ua", needs_conversion=True, affects="layout", )} diff --git a/servo/components/style/values/specified/font.rs b/servo/components/style/values/specified/font.rs index 2435682ce3c8..db3d871a0f0c 100644 --- a/servo/components/style/values/specified/font.rs +++ b/servo/components/style/values/specified/font.rs @@ -450,16 +450,6 @@ impl ToComputedValue for FontStretch { } } -#[cfg(feature = "gecko")] -fn math_depth_enabled(_context: &ParserContext) -> bool { - static_prefs::pref!("layout.css.math-depth.enabled") -} - -#[cfg(feature = "servo")] -fn math_depth_enabled(_context: &ParserContext) -> bool { - false -} - /// CSS font keywords #[derive( Animate, @@ -496,7 +486,7 @@ pub enum FontSizeKeyword { XXXLarge, /// Indicate whether to apply font-size: math is specified so that extra /// scaling due to math-depth changes is applied during the cascade. - #[parse(condition = "math_depth_enabled")] + #[cfg(feature="gecko")] Math, #[css(skip)] None, @@ -1018,7 +1008,7 @@ impl FontSize { return Ok(FontSize::Length(lp)); } - if let Ok(kw) = input.try_parse(|i| FontSizeKeyword::parse(context, i)) { + if let Ok(kw) = input.try_parse(|i| FontSizeKeyword::parse(i)) { return Ok(FontSize::Keyword(KeywordInfo::new(kw))); }