Track the restyle root and use it to do less work during the traversal.

MozReview-Commit-ID: A8O3JOpsv4E
This commit is contained in:
Bobby Holley 2017-07-18 18:38:47 -07:00
parent 0534f72925
commit d4aa8e3cef
9 changed files with 132 additions and 68 deletions

View file

@ -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.