mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Bail out from invalidation if we're the root and got tons of descendant invalidations.
Bug: 1420741 Reviewed-by: heycam MozReview-Commit-ID: 4Kja20Ep9qD
This commit is contained in:
parent
cc8f9305e4
commit
2beb441d04
1 changed files with 11 additions and 0 deletions
|
@ -229,6 +229,17 @@ where
|
|||
collector.invalidates_self
|
||||
};
|
||||
|
||||
// If we generated a ton of descendant invalidations, it's probably not
|
||||
// worth to go ahead and try to process them.
|
||||
//
|
||||
// Just restyle the descendants directly.
|
||||
//
|
||||
// This number is completely made-up, but the page that made us add this
|
||||
// code generated 1960+ invalidations (bug 1420741).
|
||||
if descendant_invalidations.len() > 150 {
|
||||
self.data.hint.insert(RestyleHint::RESTYLE_DESCENDANTS);
|
||||
}
|
||||
|
||||
if invalidated_self {
|
||||
self.data.hint.insert(RestyleHint::RESTYLE_SELF);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue