mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -182,25 +182,28 @@ where
|
|||
|
||||
/// Flush the current set, unmarking it as dirty, and returns an iterator
|
||||
/// over the new stylesheet list.
|
||||
///
|
||||
/// Returns true if any elements were invalidated.
|
||||
pub fn flush<E>(
|
||||
&mut self,
|
||||
document_element: Option<E>,
|
||||
) -> (StylesheetIterator<S>, OriginSet)
|
||||
) -> (StylesheetIterator<S>, OriginSet, bool)
|
||||
where
|
||||
E: TElement,
|
||||
{
|
||||
debug!("StylesheetSet::flush");
|
||||
|
||||
let mut origins = OriginSet::empty();
|
||||
let mut have_invalidations = false;
|
||||
for (data, origin) in self.invalidation_data.iter_mut_origins() {
|
||||
if data.dirty {
|
||||
data.invalidations.flush(document_element);
|
||||
have_invalidations |= data.invalidations.flush(document_element);
|
||||
data.dirty = false;
|
||||
origins |= origin;
|
||||
}
|
||||
}
|
||||
|
||||
(self.iter(), origins)
|
||||
(self.iter(), origins, have_invalidations)
|
||||
}
|
||||
|
||||
/// Flush stylesheets, but without running any of the invalidation passes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue