mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +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
|
@ -481,19 +481,20 @@ impl Stylist {
|
|||
ua_sheets: Option<&UserAgentStylesheets>,
|
||||
extra_data: &mut PerOrigin<ExtraStyleData>,
|
||||
document_element: Option<E>,
|
||||
)
|
||||
) -> bool
|
||||
where
|
||||
E: TElement,
|
||||
{
|
||||
if !self.stylesheets.has_changed() {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
let author_style_disabled = self.stylesheets.author_style_disabled();
|
||||
let (doc_stylesheets, origins_to_rebuild) = self.stylesheets.flush(document_element);
|
||||
let (doc_stylesheets, origins_to_rebuild, have_invalidations) =
|
||||
self.stylesheets.flush(document_element);
|
||||
|
||||
if origins_to_rebuild.is_empty() {
|
||||
return;
|
||||
return have_invalidations;
|
||||
}
|
||||
|
||||
self.num_rebuilds += 1;
|
||||
|
@ -538,6 +539,8 @@ impl Stylist {
|
|||
extra_data,
|
||||
origins_to_rebuild,
|
||||
);
|
||||
|
||||
have_invalidations
|
||||
}
|
||||
|
||||
/// Insert a given stylesheet before another stylesheet in the document.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue