From 4359aae44e08b92eda0de557c5abbf37491dba08 Mon Sep 17 00:00:00 2001 From: longsonr Date: Wed, 13 May 2020 09:10:54 +0000 Subject: [PATCH] style: Don't apply minimum font sizes to SVG text. Differential Revision: https://phabricator.services.mozilla.com/D74581 --- components/style/properties/cascade.rs | 6 +++--- components/style/properties/gecko.mako.rs | 6 +++--- components/style/values/computed/mod.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/style/properties/cascade.rs b/components/style/properties/cascade.rs index 807e1d70ff5..ab60099b3a4 100644 --- a/components/style/properties/cascade.rs +++ b/components/style/properties/cascade.rs @@ -920,8 +920,8 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> { let builder = &mut self.context.builder; - let parent_zoom = builder.get_parent_font().gecko().mAllowZoom; - let zoom = builder.get_font().gecko().mAllowZoom; + let parent_zoom = builder.get_parent_font().gecko().mAllowZoomAndMinSize; + let zoom = builder.get_font().gecko().mAllowZoomAndMinSize; if zoom == parent_zoom { return; } @@ -968,7 +968,7 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> { } let mut min = Au(parent_font.mScriptMinSize); - if font.mAllowZoom { + if font.mAllowZoomAndMinSize { min = builder.device.zoom_text(min); } diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 8b10d71c146..69d0ac3fb92 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -1108,12 +1108,12 @@ fn static_assert() { #[allow(non_snake_case)] pub fn set__x_text_zoom(&mut self, v: longhands::_x_text_zoom::computed_value::T) { - self.gecko.mAllowZoom = v.0; + self.gecko.mAllowZoomAndMinSize = v.0; } #[allow(non_snake_case)] pub fn copy__x_text_zoom_from(&mut self, other: &Self) { - self.gecko.mAllowZoom = other.gecko.mAllowZoom; + self.gecko.mAllowZoomAndMinSize = other.gecko.mAllowZoomAndMinSize; } #[allow(non_snake_case)] @@ -1123,7 +1123,7 @@ fn static_assert() { #[allow(non_snake_case)] pub fn clone__x_text_zoom(&self) -> longhands::_x_text_zoom::computed_value::T { - longhands::_x_text_zoom::computed_value::T(self.gecko.mAllowZoom) + longhands::_x_text_zoom::computed_value::T(self.gecko.mAllowZoomAndMinSize) } <% impl_simple_type_with_conversion("font_language_override", "mFont.languageOverride") %> diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index 468deac4592..aba433d7443 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -223,8 +223,8 @@ impl<'a> Context<'a> { pub fn maybe_zoom_text(&self, size: CSSPixelLength) -> CSSPixelLength { // We disable zoom for by unsetting the // -x-text-zoom property, which leads to a false value - // in mAllowZoom - if self.style().get_font().gecko.mAllowZoom { + // in mAllowZoomAndMinSize + if self.style().get_font().gecko.mAllowZoomAndMinSize { self.device().zoom_text(Au::from(size)).into() } else { size