servo: Merge #19432 - style: Bail out from invalidation if we're the root and got tons of descendant invalidations (from emilio:invalidation-bail); r=heycam

Bug: 1420741
Reviewed-by: heycam
MozReview-Commit-ID: 4Kja20Ep9qD
Source-Repo: https://github.com/servo/servo
Source-Revision: e4d5e9699b9e784e5eba0aec316a35d048786052

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 705ee3ef74c8f09702fa0e09bd9924f58bfc8ac7
This commit is contained in:
Emilio Cobos Álvarez 2017-11-30 05:30:01 -06:00
Родитель 91251dce14
Коммит b941bc4b3f
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -229,6 +229,17 @@ where
collector.invalidates_self 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 { if invalidated_self {
self.data.hint.insert(RestyleHint::RESTYLE_SELF); self.data.hint.insert(RestyleHint::RESTYLE_SELF);
} }