style: Ensure QuerySelector only processes the light tree.

MozReview-Commit-ID: 7Nw1SEuWNaC
This commit is contained in:
Emilio Cobos Álvarez 2017-10-22 13:11:18 +02:00
parent dd7196949f
commit 644b502b0d
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 12 additions and 0 deletions

View file

@ -133,6 +133,8 @@ where
Q: SelectorQuery<E>,
Q::Output: 'a,
{
fn light_tree_only(&self) -> bool { true }
fn collect_invalidations(
&mut self,
element: E,

View file

@ -24,6 +24,11 @@ where
/// that would originate it.
fn invalidates_on_eager_pseudo_element(&self) -> bool { false }
/// Whether the invalidation processor only cares about light-tree
/// descendants of a given element, that is, doesn't invalidate
/// pseudo-elements, NAC, or XBL anon content.
fn light_tree_only(&self) -> bool { false }
/// The matching context that should be used to process invalidations.
fn matching_context(&mut self) -> &mut MatchingContext<'a, E::Impl>;
@ -460,6 +465,11 @@ where
}
}
if self.processor.light_tree_only() {
let node = self.element.as_node();
return self.invalidate_dom_descendants_of(node, invalidations);
}
let mut any_descendant = false;
if let Some(anon_content) = self.element.xbl_binding_anonymous_content() {