From 60511611bb5adf80d13a6c3474919d3c5f3c51c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 17 Sep 2017 04:57:22 +0200 Subject: [PATCH 1/2] stylo: Don't add a font-size dependency to the rule cache if the reference size is not our current style. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We enter the Custom(..) code path from other random places, like to remove the relative lengths from a calc expression while zooming, or whatever craziness MathML font-size uses, and we don't want to set the dependency on those cases. MozReview-Commit-ID: HNatSGlzDkK Signed-off-by: Emilio Cobos Álvarez --- components/style/values/specified/length.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index c4da56cf600..4a5f213d976 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -132,7 +132,7 @@ impl FontRelativeLength { match *self { FontRelativeLength::Em(length) => { - if !matches!(base_size, FontBaseSize::InheritedStyle) { + if matches!(base_size, FontBaseSize::CurrentStyle) { context.rule_cache_conditions.borrow_mut() .set_font_size_dependency( reference_font_size.into() From ee49f0eaec91926a7b1b3ce5eab235e51bf7200e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 17 Sep 2017 05:07:27 +0200 Subject: [PATCH 2/2] style: bonus point: only add the condition when computing reset properties. --- components/style/values/specified/length.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index 4a5f213d976..3c7c8a722f1 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -132,11 +132,13 @@ impl FontRelativeLength { match *self { FontRelativeLength::Em(length) => { - if matches!(base_size, FontBaseSize::CurrentStyle) { - context.rule_cache_conditions.borrow_mut() - .set_font_size_dependency( - reference_font_size.into() - ); + if context.for_non_inherited_property.is_some() { + if matches!(base_size, FontBaseSize::CurrentStyle) { + context.rule_cache_conditions.borrow_mut() + .set_font_size_dependency( + reference_font_size.into() + ); + } } (reference_font_size, length) },