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:
Emilio Cobos Álvarez 2017-11-28 12:05:30 +01:00
parent cc8f9305e4
commit 2beb441d04
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

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