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
This commit is contained in:
Timothy Nikkel 2019-09-20 02:05:35 +00:00
parent 6c211da0ae
commit 239c12b7f0

View File

@ -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-<svg> 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())) {