Bug 1365333 - Avoid quadratic performance in nsDisplayLayerEventRegions::AddFrame() when the maybe-hit region has many rects. r=tnikkel

MozReview-Commit-ID: 99QrhFpHw15

--HG--
extra : rebase_source : 07201ca9b9728e9b1fa77755614ce8cd95753430
This commit is contained in:
Botond Ballo 2017-05-31 14:42:59 -04:00
Родитель 0a31d50d11
Коммит 6e273c8fd1
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -4422,6 +4422,10 @@ nsDisplayLayerEventRegions::AddFrame(nsDisplayListBuilder* aBuilder,
if (borderBoxHasRoundedCorners ||
(aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT)) {
mMaybeHitRegion.Or(mMaybeHitRegion, borderBox);
// Avoid quadratic performance as a result of the region growing to include
// an arbitrarily large number of rects, which can happen on some pages.
mMaybeHitRegion.SimplifyOutward(8);
} else {
mHitRegion.Or(mHitRegion, borderBox);
}