tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 716f7f4a5ac3d8cb4dbabdc72781fe49fbac9541
parent 12d8474e45d73748da2f9ab703d0434371bf8a57
Author: Oriol Brufau <obrufau@igalia.com>
Date:   Tue,  7 Oct 2025 23:16:08 +0000

Bug 1992880 - Restrict `font-family: math` to Gecko. r=firefox-style-system-reviewers,emilio

This is a fixup for https://phabricator.services.mozilla.com/D256978

Differential Revision: https://phabricator.services.mozilla.com/D267695

Diffstat:
Mservo/components/style/values/computed/font.rs | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/servo/components/style/values/computed/font.rs b/servo/components/style/values/computed/font.rs @@ -420,6 +420,7 @@ impl FontFamily { generic_font_family!(MONOSPACE, Monospace); generic_font_family!(CURSIVE, Cursive); generic_font_family!(FANTASY, Fantasy); + #[cfg(feature = "gecko")] generic_font_family!(MATH, Math); #[cfg(feature = "gecko")] generic_font_family!(MOZ_EMOJI, MozEmoji); @@ -435,6 +436,7 @@ impl FontFamily { GenericFontFamily::Monospace => &*MONOSPACE, GenericFontFamily::Cursive => &*CURSIVE, GenericFontFamily::Fantasy => &*FANTASY, + #[cfg(feature = "gecko")] GenericFontFamily::Math => &*MATH, #[cfg(feature = "gecko")] GenericFontFamily::MozEmoji => &*MOZ_EMOJI, @@ -577,6 +579,7 @@ fn system_ui_enabled(_: &ParserContext) -> bool { static_prefs::pref!("layout.css.system-ui.enabled") } +#[cfg(feature = "gecko")] fn math_enabled(context: &ParserContext) -> bool { context.chrome_rules_enabled() || static_prefs::pref!("mathml.font_family_math.enabled") } @@ -619,6 +622,7 @@ pub enum GenericFontFamily { Monospace, Cursive, Fantasy, + #[cfg(feature = "gecko")] #[parse(condition = "math_enabled")] Math, #[parse(condition = "system_ui_enabled")] @@ -635,9 +639,9 @@ impl GenericFontFamily { /// the user. See bug 789788 and bug 1730098. pub(crate) fn valid_for_user_font_prioritization(self) -> bool { match self { - Self::None | Self::Cursive | Self::Fantasy | Self::Math | Self::SystemUi => false, + Self::None | Self::Cursive | Self::Fantasy | Self::SystemUi => false, #[cfg(feature = "gecko")] - Self::MozEmoji => false, + Self::Math | Self::MozEmoji => false, Self::Serif | Self::SansSerif | Self::Monospace => true, } }