From ad62a2c0e8fbf59cada2af0a12cec11b31fd3670 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Thu, 18 Mar 2021 00:55:51 +0000 Subject: [PATCH] Bug 1699302 part 1: Use "InProcess" version of GetCrossDocParentFrame(), when propagating invalidation up the ancestor chain, in nsIFrame.cpp. r=hiro This patch doesn't change behavior; it's just switching us between two functions that do the same thing. (One is literally a trivial wrapper for the other.) We're using the new "InProcess" version of this API as a way of annotating callsites that have been vetted as behaving properly in out-of-process iframes. This patch is focusing on some callsites where we've got a frame that needs a repaint, and we're propagate that information up its ancestor chain. It's OK for these notifications to stop when we hit the edge of of an out-of-process iframe, because painting/compositing at that granularity is handled separately. Differential Revision: https://phabricator.services.mozilla.com/D108877 --- layout/generic/nsIFrame.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp index 5e33f1364f33..f05b90aee059 100644 --- a/layout/generic/nsIFrame.cpp +++ b/layout/generic/nsIFrame.cpp @@ -7011,7 +7011,7 @@ static void InvalidateRenderingObservers(nsIFrame* aDisplayRoot, SVGObserverUtils::InvalidateDirectRenderingObservers(aFrame); nsIFrame* parent = aFrame; while (parent != aDisplayRoot && - (parent = nsLayoutUtils::GetCrossDocParentFrame(parent)) && + (parent = nsLayoutUtils::GetCrossDocParentFrameInProcess(parent)) && !parent->HasAnyStateBits(NS_FRAME_DESCENDANT_NEEDS_PAINT)) { SVGObserverUtils::InvalidateDirectRenderingObservers(parent); } @@ -7066,7 +7066,7 @@ static void InvalidateFrameInternal(nsIFrame* aFrame, bool aHasDisplayItem, if (nsLayoutUtils::IsPopup(aFrame)) { needsSchedulePaint = true; } else { - nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrame(aFrame); + nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrameInProcess(aFrame); while (parent && !parent->HasAnyStateBits(NS_FRAME_DESCENDANT_NEEDS_PAINT)) { if (aHasDisplayItem && !parent->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) { @@ -7081,7 +7081,7 @@ static void InvalidateFrameInternal(nsIFrame* aFrame, bool aHasDisplayItem, needsSchedulePaint = true; break; } - parent = nsLayoutUtils::GetCrossDocParentFrame(parent); + parent = nsLayoutUtils::GetCrossDocParentFrameInProcess(parent); } if (!parent) { needsSchedulePaint = true; @@ -10853,7 +10853,7 @@ void nsIFrame::SetParent(nsContainerFrame* aParent) { for (nsIFrame* f = aParent; f && !f->HasAnyStateBits(NS_FRAME_DESCENDANT_NEEDS_PAINT | NS_FRAME_IS_NONDISPLAY); - f = nsLayoutUtils::GetCrossDocParentFrame(f)) { + f = nsLayoutUtils::GetCrossDocParentFrameInProcess(f)) { f->AddStateBits(NS_FRAME_DESCENDANT_NEEDS_PAINT); } }