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] 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) },