From 6f2861e466bd49d9ce5f12a0f98eeaf7300a25c1 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Sat, 23 Sep 2023 19:30:11 +0200 Subject: [PATCH] Further changes required by Servo --- components/style/font_face.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/style/font_face.rs b/components/style/font_face.rs index d9c547a1e18..f0728f00ae6 100644 --- a/components/style/font_face.rs +++ b/components/style/font_face.rs @@ -528,6 +528,13 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for FontFaceRuleParser<'a, 'b> { type Error = StyleParseErrorKind<'i>; } +fn font_tech_enabled() -> bool { + #[cfg(feature = "gecko")] + return static_prefs::pref!("layout.css.font-tech.enabled"); + #[cfg(feature = "servo")] + return false; +} + impl Parse for Source { fn parse<'i, 't>( context: &ParserContext, @@ -562,7 +569,7 @@ impl Parse for Source { }; // Parse optional tech() - let tech_flags = if static_prefs::pref!("layout.css.font-tech.enabled") && input + let tech_flags = if font_tech_enabled() && input .try_parse(|input| input.expect_function_matching("tech")) .is_ok() {