From a6f32bc762194c1233271b906caaeaabd6f6eb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 4 Apr 2019 03:46:55 +0000 Subject: [PATCH] style: Fix revalidation in subtree. So as to avoid incorrectly sharing styles across elements. Differential Revision: https://phabricator.services.mozilla.com/D25918 --- components/style/dom.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/style/dom.rs b/components/style/dom.rs index 28798e280b6..63f82a3754f 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -825,11 +825,15 @@ pub trait TElement: Self: 'a, F: FnMut(&'a CascadeData, QuirksMode, Option), { + use rule_collector::containing_shadow_ignoring_svg_use; + let mut doc_rules_apply = !self.each_xbl_cascade_data(|data, quirks_mode| { f(data, quirks_mode, None); }); - if let Some(shadow) = self.containing_shadow() { + // Use the same rules to look for the containing host as we do for rule + // collection. + if let Some(shadow) = containing_shadow_ignoring_svg_use(*self) { doc_rules_apply = false; if let Some(data) = shadow.style_data() { f(