From bec81dc9c2da399ece93405b38dc8593f6cf45df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 29 Apr 2019 08:04:22 +0000 Subject: [PATCH] style: Fix :-moz-svg-use-shadow-tree-root pseudo-class. Turns out removing the pseudo-class and such ends up not being quite as trivial as I initially thought, or possible at all, since the fact that the is a is observable via selectors, added a test for that. Differential Revision: https://phabricator.services.mozilla.com/D29131 --- components/style/gecko/wrapper.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index c295b795fdc..079dde2f513 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -865,10 +865,11 @@ impl<'le> GeckoElement<'le> { if !self.as_node().is_in_shadow_tree() { return false; } - match self.containing_shadow_host() { - Some(e) => e.is_svg_element() && e.local_name() == &*local_name!("use"), - None => false, + if !self.parent_node_is_shadow_root() { + return false; } + let host = self.containing_shadow_host().unwrap(); + host.is_svg_element() && host.local_name() == &*local_name!("use") } fn css_transitions_info(&self) -> FxHashMap> {