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
--- 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()