mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Ensure invalidated_self is called at most once per element.
MozReview-Commit-ID: 1M0WuAduqun
This commit is contained in:
parent
bd2a82334b
commit
7f5536d5bc
1 changed files with 17 additions and 5 deletions
|
@ -240,12 +240,18 @@ where
|
|||
debug!(" > descendants: {:?}", descendant_invalidations);
|
||||
debug!(" > siblings: {:?}", sibling_invalidations);
|
||||
|
||||
let invalidated_self_from_collection = invalidated_self;
|
||||
|
||||
invalidated_self |= self.process_descendant_invalidations(
|
||||
&self_invalidations,
|
||||
&mut descendant_invalidations,
|
||||
&mut sibling_invalidations,
|
||||
);
|
||||
|
||||
if invalidated_self && !invalidated_self_from_collection {
|
||||
self.processor.invalidated_self(self.element);
|
||||
}
|
||||
|
||||
let invalidated_descendants = self.invalidate_descendants(&descendant_invalidations);
|
||||
let invalidated_siblings = self.invalidate_siblings(&mut sibling_invalidations);
|
||||
|
||||
|
@ -276,12 +282,18 @@ where
|
|||
);
|
||||
|
||||
let mut invalidations_for_descendants = InvalidationVector::new();
|
||||
any_invalidated |=
|
||||
let invalidated_sibling =
|
||||
sibling_invalidator.process_sibling_invalidations(
|
||||
&mut invalidations_for_descendants,
|
||||
sibling_invalidations,
|
||||
);
|
||||
|
||||
if invalidated_sibling {
|
||||
sibling_invalidator.processor.invalidated_self(sibling);
|
||||
}
|
||||
|
||||
any_invalidated |= invalidated_sibling;
|
||||
|
||||
any_invalidated |=
|
||||
sibling_invalidator.invalidate_descendants(
|
||||
&invalidations_for_descendants
|
||||
|
@ -351,6 +363,10 @@ where
|
|||
sibling_invalidations,
|
||||
);
|
||||
|
||||
if invalidated_child {
|
||||
child_invalidator.processor.invalidated_self(child);
|
||||
}
|
||||
|
||||
child_invalidator.invalidate_descendants(&invalidations_for_descendants)
|
||||
};
|
||||
|
||||
|
@ -718,10 +734,6 @@ where
|
|||
CompoundSelectorMatchingResult::NotMatched => {}
|
||||
}
|
||||
|
||||
if invalidated_self {
|
||||
self.processor.invalidated_self(self.element);
|
||||
}
|
||||
|
||||
SingleInvalidationResult { invalidated_self, matched, }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue