From 3f03650c883c83965222b4a2bf5a89fd4ed68e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 11 May 2023 19:01:19 +0000 Subject: [PATCH] style: Plumb android text scale via nsLookAndFeel That's how we do it for all other platforms. Do this rather than via a custom mostly-untested pref, which allows us to simplify text zoom handling. Differential Revision: https://phabricator.services.mozilla.com/D177062 --- components/style/gecko/media_queries.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs index c5a5c5723af..d937b67dfe1 100644 --- a/components/style/gecko/media_queries.rs +++ b/components/style/gecko/media_queries.rs @@ -511,24 +511,24 @@ impl Device { /// Returns the current effective text zoom. #[inline] - fn effective_text_zoom(&self) -> f32 { + fn text_zoom(&self) -> f32 { let pc = match self.pres_context() { Some(pc) => pc, None => return 1., }; - pc.mEffectiveTextZoom + pc.mTextZoom } /// Applies text zoom to a font-size or line-height value (see nsStyleFont::ZoomText). #[inline] pub fn zoom_text(&self, size: Length) -> Length { - size.scale_by(self.effective_text_zoom()) + size.scale_by(self.text_zoom()) } /// Un-apply text zoom. #[inline] pub fn unzoom_text(&self, size: Length) -> Length { - size.scale_by(1. / self.effective_text_zoom()) + size.scale_by(1. / self.text_zoom()) } /// Returns safe area insets