Bug 1425759: Make a style sharing check account for Shadow DOM explicitly too. r?xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 25 Feb 2018 19:01:42 +0100
changeset 759774 f3fbe2971dfcd9af39c551cfedf211fe0ccd85c1
parent 759773 f87cc99183d50caafa78071901080ef573ae84be
child 759775 3dabd35e65bea69bc1224af5699726d310367115
push id100460
push userbmo:emilio@crisal.io
push dateMon, 26 Feb 2018 16:00:57 +0000
reviewersxidorn
bugs1425759
milestone60.0a1
Bug 1425759: Make a style sharing check account for Shadow DOM explicitly too. r?xidorn Good I added tests for this (style-sharing-across-shadow.html). MozReview-Commit-ID: 7d4WioCDAn7
servo/components/style/gecko/wrapper.rs
--- a/servo/components/style/gecko/wrapper.rs
+++ b/servo/components/style/gecko/wrapper.rs
@@ -986,17 +986,17 @@ impl<'le> TElement for GeckoElement<'le>
         if self.implemented_pseudo_element().is_some() {
             return self.closest_non_native_anonymous_ancestor().unwrap().style_scope();
         }
 
         if self.is_in_native_anonymous_subtree() {
             return self.as_node().owner_doc().as_node();
         }
 
-        if self.xbl_binding().is_some() {
+        if self.xbl_binding().is_some() || self.shadow_root().is_some() {
             return self.as_node();
         }
 
         if let Some(parent) = self.xbl_binding_parent() {
             return parent.as_node();
         }
 
         self.as_node().owner_doc().as_node()