mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Make svg:use use an actual shadow tree.
This fixes a couple fuzz bugs and prevents special-casing <svg:use> even more in bug 1431255. Unfortunately not as many hacks went away as I'd have hoped, since we still need to match document rules, see the linked SVGWG issues. But blocks_ancestor_combinators goes away, which is nice since it's on a very hot path. Bug: 1450250 Reviewed-by: heycam Differential Revision: https://phabricator.services.mozilla.com/D2154 MozReview-Commit-ID: C4mthjoSNFh
This commit is contained in:
parent
1a91beaf57
commit
02d27ad3dd
5 changed files with 25 additions and 29 deletions
|
@ -856,13 +856,12 @@ impl<'le> GeckoElement<'le> {
|
|||
/// Returns true if this node is the shadow root of an use-element shadow tree.
|
||||
#[inline]
|
||||
fn is_root_of_use_element_shadow_tree(&self) -> bool {
|
||||
if !self.is_root_of_anonymous_subtree() {
|
||||
if !self.as_node().is_in_shadow_tree() {
|
||||
return false;
|
||||
}
|
||||
match self.parent_element() {
|
||||
match self.containing_shadow_host() {
|
||||
Some(e) => {
|
||||
e.local_name() == &*local_name!("use") &&
|
||||
e.is_svg_element()
|
||||
e.is_svg_element() && e.local_name() == &*local_name!("use")
|
||||
},
|
||||
None => false,
|
||||
}
|
||||
|
@ -2332,14 +2331,6 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
|
|||
fn ignores_nth_child_selectors(&self) -> bool {
|
||||
self.is_root_of_anonymous_subtree()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn blocks_ancestor_combinators(&self) -> bool {
|
||||
// If this element is the shadow root of an use-element shadow tree,
|
||||
// according to the spec, we should not match rules cross the shadow
|
||||
// DOM boundary.
|
||||
self.is_root_of_use_element_shadow_tree()
|
||||
}
|
||||
}
|
||||
|
||||
/// A few helpers to help with attribute selectors and snapshotting.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue