From 239c12b7f0098345747ee994b0bc929b5d3a64e3 Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Fri, 20 Sep 2019 02:05:35 +0000 Subject: [PATCH] Bug 1582528. Restrict visual and dirty rect when building the display list for svg contents that cannot overflow. r=mstange Differential Revision: https://phabricator.services.mozilla.com/D46555 --HG-- extra : moz-landing-system : lando --- layout/svg/nsSVGOuterSVGFrame.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index 5330b4aecfd2..7c4b3088cf1b 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -764,13 +764,21 @@ void nsSVGOuterSVGFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, DisplayBorderBackgroundOutline(aBuilder, aLists); + nsRect visibleRect = aBuilder->GetVisibleRect(); + nsRect dirtyRect = aBuilder->GetDirtyRect(); + // Per-spec, we always clip root- even when 'overflow' has its initial // value of 'visible'. See also the "visual overflow" comments in Reflow. DisplayListClipState::AutoSaveRestore autoSR(aBuilder); if (mIsRootContent || StyleDisplay()->IsScrollableOverflow()) { autoSR.ClipContainingBlockDescendantsToContentBox(aBuilder, this); + visibleRect = visibleRect.Intersect(GetContentRectRelativeToSelf()); + dirtyRect = dirtyRect.Intersect(GetContentRectRelativeToSelf()); } + nsDisplayListBuilder::AutoBuildingDisplayList building( + aBuilder, this, visibleRect, dirtyRect); + if ((aBuilder->IsForEventDelivery() && NS_SVGDisplayListHitTestingEnabled()) || (!aBuilder->IsForEventDelivery() && NS_SVGDisplayListPaintingEnabled())) {