mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Track the restyle root and use it to do less work during the traversal.
MozReview-Commit-ID: A8O3JOpsv4E
This commit is contained in:
parent
0534f72925
commit
d4aa8e3cef
9 changed files with 132 additions and 68 deletions
|
@ -117,13 +117,17 @@ impl StylesheetInvalidationSet {
|
|||
|
||||
/// Clears the invalidation set, invalidating elements as needed if
|
||||
/// `document_element` is provided.
|
||||
pub fn flush<E>(&mut self, document_element: Option<E>)
|
||||
///
|
||||
/// Returns true if any invalidations ocurred.
|
||||
pub fn flush<E>(&mut self, document_element: Option<E>) -> bool
|
||||
where E: TElement,
|
||||
{
|
||||
if let Some(e) = document_element {
|
||||
self.process_invalidations(e);
|
||||
}
|
||||
let have_invalidations = match document_element {
|
||||
Some(e) => self.process_invalidations(e),
|
||||
None => false,
|
||||
};
|
||||
self.clear();
|
||||
have_invalidations
|
||||
}
|
||||
|
||||
/// Clears the invalidation set without processing.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue