style: Make the StyleSheetSet::flush API slightly nicer.

MozReview-Commit-ID: LfJxZA9zhaE
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-08-22 14:41:48 +02:00
parent 1c9c0334ba
commit a98fd5e2b6
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 13 additions and 10 deletions

View file

@ -180,14 +180,12 @@ where
.any(|(d, _)| d.dirty)
}
/// Flush the current set, unmarking it as dirty, and returns an iterator
/// over the new stylesheet list.
///
/// Returns true if any elements were invalidated.
/// Flush the current set, unmarking it as dirty, and returns the damaged
/// origins, and whether any elements were invalidated.
pub fn flush<E>(
&mut self,
document_element: Option<E>,
) -> (StylesheetIterator<S>, OriginSet, bool)
) -> (OriginSet, bool)
where
E: TElement,
{
@ -195,6 +193,7 @@ where
let mut origins = OriginSet::empty();
let mut have_invalidations = false;
for (data, origin) in self.invalidation_data.iter_mut_origins() {
if data.dirty {
have_invalidations |= data.invalidations.flush(document_element);
@ -203,7 +202,7 @@ where
}
}
(self.iter(), origins, have_invalidations)
(origins, have_invalidations)
}
/// Flush stylesheets, but without running any of the invalidation passes.