diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index a67354c05db4..8d26aa422ade 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -2758,8 +2758,10 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder, // We rebuild everything within preserve-3d and don't try // to retain, so override the dirty rect now. - dirtyRect = visibleRect; - aBuilder->MarkFrameModifiedDuringBuilding(this); + if (aBuilder->IsRetainingDisplayList()) { + dirtyRect = visibleRect; + aBuilder->MarkFrameModifiedDuringBuilding(this); + } } bool inTransform = aBuilder->IsInTransform();