From 2edb1517822a5151c6a56061bae830bd2840e6b2 Mon Sep 17 00:00:00 2001 From: Frederic Wang Date: Sat, 3 Sep 2022 07:09:44 +0000 Subject: [PATCH] style: Do not reset font-weight/font-style when mathvariant is specified In the past, mathvariant was cancelling the effect of legacy fontstyle/fontweight attributes by resetting the font-style/font-weight properties. These legacy attributes have been removed in bug 1783841, so remove this hack from Stylo and add corresponding WPT test. Differential Revision: https://phabricator.services.mozilla.com/D156174 --- components/style/style_adjuster.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/components/style/style_adjuster.rs b/components/style/style_adjuster.rs index 6fb2ecac4bf..b855b937dfb 100644 --- a/components/style/style_adjuster.rs +++ b/components/style/style_adjuster.rs @@ -361,19 +361,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { } } - /// When mathvariant is not "none", font-weight and font-style are - /// both forced to "normal". - #[cfg(feature = "gecko")] - fn adjust_for_mathvariant(&mut self) { - use crate::properties::longhands::_moz_math_variant::computed_value::T as MozMathVariant; - use crate::values::computed::font::{FontWeight, FontStyle}; - if self.style.get_font().clone__moz_math_variant() != MozMathVariant::None { - let font_style = self.style.mutate_font(); - font_style.set_font_weight(FontWeight::NORMAL); - font_style.set_font_style(FontStyle::NORMAL); - } - } - /// This implements an out-of-date spec. The new spec moves the handling of /// this to layout, which Gecko implements but Servo doesn't. /// @@ -874,7 +861,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { #[cfg(feature = "gecko")] { self.adjust_for_table_text_align(); - self.adjust_for_mathvariant(); self.adjust_for_justify_items(); } #[cfg(feature = "servo")]