mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Ensure QuerySelector only processes the light tree.
MozReview-Commit-ID: 7Nw1SEuWNaC
This commit is contained in:
parent
dd7196949f
commit
644b502b0d
2 changed files with 12 additions and 0 deletions
|
@ -133,6 +133,8 @@ where
|
||||||
Q: SelectorQuery<E>,
|
Q: SelectorQuery<E>,
|
||||||
Q::Output: 'a,
|
Q::Output: 'a,
|
||||||
{
|
{
|
||||||
|
fn light_tree_only(&self) -> bool { true }
|
||||||
|
|
||||||
fn collect_invalidations(
|
fn collect_invalidations(
|
||||||
&mut self,
|
&mut self,
|
||||||
element: E,
|
element: E,
|
||||||
|
|
|
@ -24,6 +24,11 @@ where
|
||||||
/// that would originate it.
|
/// that would originate it.
|
||||||
fn invalidates_on_eager_pseudo_element(&self) -> bool { false }
|
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.
|
/// The matching context that should be used to process invalidations.
|
||||||
fn matching_context(&mut self) -> &mut MatchingContext<'a, E::Impl>;
|
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;
|
let mut any_descendant = false;
|
||||||
|
|
||||||
if let Some(anon_content) = self.element.xbl_binding_anonymous_content() {
|
if let Some(anon_content) = self.element.xbl_binding_anonymous_content() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue