Auto merge of #19432 - emilio:invalidation-bail, r=heycam

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:
bors-servo 2017-11-30 05:30:01 -06:00 committed by GitHub
commit e4d5e9699b

View file

@ -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);
}