tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 1b1577cc4a0ee3d1ffa62824873b5707fda5c7f5
parent e64ec53679977f308a7b46cb5de9b858bc02dede
Author: Timothy Nikkel <tnikkel@gmail.com>
Date:   Mon,  8 Dec 2025 04:46:21 +0000

Bug 2004591. Move to nsLayoutUtils::GetASRAncestorFrame to DisplayPortUtils and separate it from GetNearestScrollableOrOverflowClipFrame in nsLayoutUtils. r=hiro,layout-reviewers

I want to make a bug fix that changes the return type of GetASRAncestorFrame and OneStepInASRChain to (ASRKind, frame) so that the relation of scroll and sticky ASRs can better be represented in these functions. Trying to shoe horn all these different behaviour into one function is getting kind of complicated.

I also took the opportunity to move OneStepInAsyncScrollableAncestorChain, OneStepInASRChain, and GetASRAncestorFrame into the same place in DisplayPortUtils by ActivateDisplayportOnASRAncestors so that all this similar code is in the same place.

Differential Revision: https://phabricator.services.mozilla.com/D275373

Diffstat:
Mlayout/base/DisplayPortUtils.cpp | 167++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
Mlayout/base/DisplayPortUtils.h | 66+++++++++++++++++++++++++++++++++++++++++++++---------------------
Mlayout/base/nsLayoutUtils.cpp | 58+++++++---------------------------------------------------
Mlayout/base/nsLayoutUtils.h | 34+---------------------------------
Mlayout/generic/nsIFrame.cpp | 4++--
5 files changed, 169 insertions(+), 160 deletions(-)

diff --git a/layout/base/DisplayPortUtils.cpp b/layout/base/DisplayPortUtils.cpp @@ -850,55 +850,6 @@ bool DisplayPortUtils::MaybeCreateDisplayPort( return false; } -nsIFrame* DisplayPortUtils::OneStepInAsyncScrollableAncestorChain( - nsIFrame* aFrame) { - // This mirrors one iteration of GetNearestScrollableOrOverflowClipFrame in - // nsLayoutUtils.cpp as called by - // nsLayoutUtils::GetAsyncScrollableAncestorFrame. They should be kept in - // sync. See that function for comments about the structure of this code. - if (aFrame->IsMenuPopupFrame()) { - return nullptr; - } - nsIFrame* anchor = nullptr; - while ((anchor = - AnchorPositioningUtils::GetAnchorThatFrameScrollsWith(aFrame))) { - aFrame = anchor; - } - if (aFrame->StyleDisplay()->mPosition == StylePositionProperty::Fixed && - nsLayoutUtils::IsReallyFixedPos(aFrame)) { - if (nsIFrame* root = aFrame->PresShell()->GetRootScrollContainerFrame()) { - return root; - } - } - return nsLayoutUtils::GetCrossDocParentFrameInProcess(aFrame); -} - -nsIFrame* DisplayPortUtils::OneStepInASRChain( - nsIFrame* aFrame, nsIFrame* aLimitAncestor /* = nullptr */) { - // This mirrors one iteration of GetNearestScrollableOrOverflowClipFrame in - // nsLayoutUtils.cpp as called by nsLayoutUtils::GetASRAncestorFrame. They - // should be kept in sync. See that function for comments about the structure - // of this code. - if (aFrame->IsMenuPopupFrame()) { - return nullptr; - } - nsIFrame* anchor = nullptr; - while ((anchor = - AnchorPositioningUtils::GetAnchorThatFrameScrollsWith(aFrame))) { - MOZ_ASSERT_IF(aLimitAncestor, - nsLayoutUtils::IsProperAncestorFrameConsideringContinuations( - aLimitAncestor, anchor)); - aFrame = anchor; - } - nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrameInProcess(aFrame); - if (aLimitAncestor && parent && - (parent == aLimitAncestor || - parent->FirstContinuation() == aLimitAncestor->FirstContinuation())) { - return nullptr; - } - return parent; -} - void DisplayPortUtils::SetZeroMarginDisplayPortOnAsyncScrollableAncestors( nsIFrame* aFrame) { nsIFrame* frame = aFrame; @@ -1063,6 +1014,116 @@ bool DisplayPortUtils::WillUseEmptyDisplayPortMargins(nsIContent* aContent) { nsLayoutUtils::ShouldDisableApzForElement(aContent); } +nsIFrame* DisplayPortUtils::OneStepInAsyncScrollableAncestorChain( + nsIFrame* aFrame) { + // This mirrors one iteration of GetNearestScrollableOrOverflowClipFrame in + // nsLayoutUtils.cpp as called by + // nsLayoutUtils::GetAsyncScrollableAncestorFrame. They should be kept in + // sync. See that function for comments about the structure of this code. + if (aFrame->IsMenuPopupFrame()) { + return nullptr; + } + nsIFrame* anchor = nullptr; + while ((anchor = + AnchorPositioningUtils::GetAnchorThatFrameScrollsWith(aFrame))) { + aFrame = anchor; + } + if (aFrame->StyleDisplay()->mPosition == StylePositionProperty::Fixed && + nsLayoutUtils::IsReallyFixedPos(aFrame)) { + if (nsIFrame* root = aFrame->PresShell()->GetRootScrollContainerFrame()) { + return root; + } + } + return nsLayoutUtils::GetCrossDocParentFrameInProcess(aFrame); +} + +nsIFrame* DisplayPortUtils::GetASRAncestorFrame( + nsIFrame* aFrame, nsDisplayListBuilder* aBuilder) { + MOZ_ASSERT(aBuilder->IsPaintingToWindow()); + // This has different behaviour from + // nsLayoutUtils::GetAsyncScrollableAncestorFrame because the ASR tree is + // different from the "async scrollable ancestor chain" which is mainly used + // for activating display ports. We don't want the + // SCROLLABLE_ALWAYS_MATCH_ROOT behaviour because we only want to match the + // root if it generates an ASR. We don't want the + // SCROLLABLE_FIXEDPOS_FINDS_ROOT behaviour because the ASR tree does not jump + // from fixed pos to root (that behaviour exists so that fixed pos in the root + // document in the process can find some apzc, ASRs have no such need and that + // would be incorrect). This should be kept in sync with + // OneStepInAsyncScrollableAncestorChain, OneStepInASRChain, + // nsLayoutUtils::GetAsyncScrollableAncestorFrame. + + for (nsIFrame* f = aFrame; f; + f = nsLayoutUtils::GetCrossDocParentFrameInProcess(f)) { + if (f->IsMenuPopupFrame()) { + break; + } + + // Note that the order of checking for a scroll container frame with + // IsMaybeAsynchronouslyScrolled, anchors, and sticky pos is significant. + // The potential ASR of the scroll container frame is the "inner" one, the + // potenial ASR of the sticky is the "outer" one. + if (ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(f)) { + if (scrollContainerFrame->IsMaybeAsynchronouslyScrolled()) { + return f; + } + } + + nsIFrame* anchor = nullptr; + // This needs to be a while loop because anchors can chain, and we don't + // want to consider each frame in this loop separately (as a potential + // scrollable ancestor) because they are all equivalent in the scrollable + // ancestor chain: they all scroll together. We are not walking up the async + // scrollable ancestor chain, but rather we are moving sideways. And when + // we exit this loop the last frame might be a sticky asr, after that we + // move up (the next iteration of the outer for loop). + while ( + (anchor = AnchorPositioningUtils::GetAnchorThatFrameScrollsWith(f))) { + f = anchor; + } + + // The ordering of this sticky check and the above anchor loop is + // significant, even though a frame can't be both sticky pos and anchored + // (because anchoring requires abs pos): if we follow an anchor, the anchor + // could be an active sticky pos, so that would generate an ASR and we want + // to return that rather than do another iteration of the outer for loop + // which moves on to the (crossdoc) parent frame. + if (f->StyleDisplay()->mPosition == StylePositionProperty::Sticky) { + auto* ssc = StickyScrollContainer::GetOrCreateForFrame(f); + if (ssc && ssc->ScrollContainer()->IsMaybeAsynchronouslyScrolled()) { + return f->FirstContinuation(); + } + } + } + return nullptr; +} + +nsIFrame* DisplayPortUtils::OneStepInASRChain( + nsIFrame* aFrame, nsIFrame* aLimitAncestor /* = nullptr */) { + // This has the same basic structure as GetASRAncestorFrame since they are + // meant to be used together. So this should be kept in sync with + // GetASRAncestorFrame. See that function for more comments about the + // structure of this code. + if (aFrame->IsMenuPopupFrame()) { + return nullptr; + } + nsIFrame* anchor = nullptr; + while ((anchor = + AnchorPositioningUtils::GetAnchorThatFrameScrollsWith(aFrame))) { + MOZ_ASSERT_IF(aLimitAncestor, + nsLayoutUtils::IsProperAncestorFrameConsideringContinuations( + aLimitAncestor, anchor)); + aFrame = anchor; + } + nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrameInProcess(aFrame); + if (aLimitAncestor && parent && + (parent == aLimitAncestor || + parent->FirstContinuation() == aLimitAncestor->FirstContinuation())) { + return nullptr; + } + return parent; +} + // This first checks if aFrame is a scroll frame, if so it then tries to // activate it. Then this function returns true if aFrame generates a scroll ASR // (ie its an active scroll frame). @@ -1105,7 +1166,7 @@ const ActiveScrolledRoot* DisplayPortUtils::ActivateDisplayportOnASRAncestors( aBuilder, aLimitAncestor)); MOZ_ASSERT((aASRofLimitAncestor ? aASRofLimitAncestor->mFrame : nullptr) == - nsLayoutUtils::GetASRAncestorFrame(aLimitAncestor, aBuilder)); + GetASRAncestorFrame(aLimitAncestor, aBuilder)); MOZ_ASSERT(nsLayoutUtils::IsProperAncestorFrameConsideringContinuations( aLimitAncestor, aAnchor)); @@ -1170,9 +1231,9 @@ const ActiveScrolledRoot* DisplayPortUtils::ActivateDisplayportOnASRAncestors( MOZ_ASSERT(asr->mKind == ActiveScrolledRoot::ASRKind::Sticky); MOZ_ASSERT(asrFrame.mASRKind == ActiveScrolledRoot::ASRKind::Scroll); } else { - MOZ_ASSERT((asr ? asr->mFrame : nullptr) == - nsLayoutUtils::GetASRAncestorFrame( - OneStepInASRChain(asrFrame.mFrame), aBuilder)); + MOZ_ASSERT( + (asr ? asr->mFrame : nullptr) == + GetASRAncestorFrame(OneStepInASRChain(asrFrame.mFrame), aBuilder)); } #endif diff --git a/layout/base/DisplayPortUtils.h b/layout/base/DisplayPortUtils.h @@ -286,27 +286,6 @@ class DisplayPortUtils { ScrollContainerFrame* aScrollContainerFrame, RepaintMode aRepaintMode); /** - * Step up one frame in the async scrollable ancestor chain, to be used in - * conjunction with GetAsyncScrollableAncestorFrame to walk the async - * scrollable ancestor chain. Note this doesn't go from one async scrollable - * frame to the next. Rather this walks all frame types, taking only one - * ancestor step per call. - */ - static nsIFrame* OneStepInAsyncScrollableAncestorChain(nsIFrame* aFrame); - - /** - * Step up one frame in the ASR chain, to be used in conjunction with - * GetASRAncestorFrame to walk the ASR chain. Note this doesn't go from one - * ASR frame to the next. Rather this walks all frame types, taking only one - * ancestor step per call. Note that a frame returned from this function could - * generate two ASRs: an inner one corresponding to an activated scroll frame, - * and an outer one corresponding to sticky pos. Returns null if we hit - * aLimitAncestor. - */ - static nsIFrame* OneStepInASRChain(nsIFrame* aFrame, - nsIFrame* aLimitAncestor = nullptr); - - /** * Sets a zero margin display port on all proper ancestors of aFrame that * are async scrollable. */ @@ -340,6 +319,51 @@ class DisplayPortUtils { static bool WillUseEmptyDisplayPortMargins(nsIContent* aContent); /** + * Step up one frame in the async scrollable ancestor chain, to be used in + * conjunction with GetAsyncScrollableAncestorFrame to walk the async + * scrollable ancestor chain. Note this doesn't go from one async scrollable + * frame to the next. Rather this walks all frame types, taking only one + * ancestor step per call. + */ + static nsIFrame* OneStepInAsyncScrollableAncestorChain(nsIFrame* aFrame); + + /** + * Follows the ASR (ActiveScrolledRoot) chain of frames, so that if + * f is the frame of an ASR A, then calling this function on + * OneStepInASRChain(f) will return the frame of parent ASR of A. Frames that + * generate an ASR are scroll frames for which IsMaybeAsynchronouslyScrolled() + * returns true (aka mWillBuildScrollableLayer == true) or they are sticky + * position frames for which their corresponding scroll frame will generate an + * ASR. This function is different from + * nsLayoutUtils::GetAsyncScrollableAncestorFrame because + * GetAsyncScrollableAncestorFrame looks only for scroll frames that + * WantAsyncScroll that that function walks from fixed pos to the root scroll + * frame. Because that status (ie mWillBuildScrollableLayer) can change this + * should only be called during a paint to the window after BuildDisplayList + * has been called on aTarget so that mWillBuildScrollableLayer will have been + * updated for this paint already for any frame we need to consult. Or for + * some other reason you know that mWillBuildScrollableLayer is up to date for + * this paint for any frame that might need to be consulted, ie you just + * updated them yourself. Note that a frame returned from this function could + * generate two ASRs: an inner one corresponding to an activated scroll frame, + * and an outer one corresponding to sticky pos. + */ + static nsIFrame* GetASRAncestorFrame(nsIFrame* aFrame, + nsDisplayListBuilder* aBuilder); + + /** + * Step up one frame in the ASR chain, to be used in conjunction with + * GetASRAncestorFrame to walk the ASR chain. Note this doesn't go from one + * ASR frame to the next. Rather this walks all frame types, taking only one + * ancestor step per call. Note that a frame returned from this function could + * generate two ASRs: an inner one corresponding to an activated scroll frame, + * and an outer one corresponding to sticky pos. Returns null if we hit + * aLimitAncestor. + */ + static nsIFrame* OneStepInASRChain(nsIFrame* aFrame, + nsIFrame* aLimitAncestor = nullptr); + + /** * Calls DecideScrollableLayerEnsureDisplayport on all proper ancestors of * aAnchor that are async scrollable up to but not including aLimitAncestor * (this creates a minimal display port on all async scrollable ancestors if diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp @@ -1318,11 +1318,6 @@ static nsIFrame* GetNearestScrollableOrOverflowClipFrame( MOZ_ASSERT( aFrame, "GetNearestScrollableOrOverflowClipFrame expects a non-null frame"); - // Only one of these two flags can be set at a time. - MOZ_ASSERT_IF(aFlags & nsLayoutUtils::SCROLLABLE_ONLY_ASYNC_SCROLLABLE, - !(aFlags & nsLayoutUtils::SCROLLABLE_ONLY_ASRS)); - MOZ_ASSERT_IF(aFlags & nsLayoutUtils::SCROLLABLE_ONLY_ASRS, - !(aFlags & nsLayoutUtils::SCROLLABLE_ONLY_ASYNC_SCROLLABLE)); auto GetNextFrame = [aFlags](const nsIFrame* aFrame) -> nsIFrame* { return (aFlags & nsLayoutUtils::SCROLLABLE_SAME_DOC) @@ -1331,8 +1326,9 @@ static nsIFrame* GetNearestScrollableOrOverflowClipFrame( }; // This should be kept in sync with - // DisplayPortUtils::OneStepInAsyncScrollableAncestorChain and - // DisplayPortUtils::OneStepInASRChain. + // DisplayPortUtils::OneStepInAsyncScrollableAncestorChain, + // DisplayPortUtils::OneStepInASRChain, and + // DisplayPortUtils::GetASRAncestorFrame. for (nsIFrame* f = aFrame; f; f = GetNextFrame(f)) { if (aClipFrameCheck && aClipFrameCheck(f)) { return f; @@ -1344,8 +1340,7 @@ static nsIFrame* GetNearestScrollableOrOverflowClipFrame( // TODO: We should also stop at popup frames other than // SCROLLABLE_ONLY_ASYNC_SCROLLABLE cases. - if ((aFlags & (nsLayoutUtils::SCROLLABLE_ONLY_ASYNC_SCROLLABLE | - nsLayoutUtils::SCROLLABLE_ONLY_ASRS)) && + if ((aFlags & nsLayoutUtils::SCROLLABLE_ONLY_ASYNC_SCROLLABLE) && f->IsMenuPopupFrame()) { break; } @@ -1355,10 +1350,6 @@ static nsIFrame* GetNearestScrollableOrOverflowClipFrame( if (scrollContainerFrame->WantAsyncScroll()) { return f; } - } else if (aFlags & nsLayoutUtils::SCROLLABLE_ONLY_ASRS) { - if (scrollContainerFrame->IsMaybeAsynchronouslyScrolled()) { - return f; - } } else { ScrollStyles ss = scrollContainerFrame->GetScrollStyles(); if ((aFlags & nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN) || @@ -1387,34 +1378,18 @@ static nsIFrame* GetNearestScrollableOrOverflowClipFrame( // want to consider each frame in this loop separately (as a potential // scrollable ancestor) because they are all equivalent in the scrollable // ancestor chain: they all scroll together. We are not walking up the async - // scrollable ancestor chain, but rather we are move sideways. And when we - // exit this loop we want to move up one because we haven't yet ascended + // scrollable ancestor chain, but rather we are moving sideways. And when + // we exit this loop we want to move up one because we haven't yet ascended // (because of that same reason), and that moving up one will happen either // via the special fixed pos behaviour below or the next iteration of the // outer for loop. - if (aFlags & (nsLayoutUtils::SCROLLABLE_ONLY_ASYNC_SCROLLABLE | - nsLayoutUtils::SCROLLABLE_ONLY_ASRS)) { + if (aFlags & nsLayoutUtils::SCROLLABLE_ONLY_ASYNC_SCROLLABLE) { while ( (anchor = AnchorPositioningUtils::GetAnchorThatFrameScrollsWith(f))) { f = anchor; } } - // Note that the order of checking for anchors and sticky pos is significant - // even though a frame can't be both sticky pos and anchored (because - // anchoring requires abs pos). However, if we follow an anchor, the anchor - // could be an active sticky pos, so that would generate an ASR and we want - // to return that rather than do another iteration of the outer for loop - // which moves on to the (crossdoc) parent frame. - if (aFlags & nsLayoutUtils::SCROLLABLE_ONLY_ASRS) { - if (f->StyleDisplay()->mPosition == StylePositionProperty::Sticky) { - auto* ssc = StickyScrollContainer::GetOrCreateForFrame(f); - if (ssc && ssc->ScrollContainer()->IsMaybeAsynchronouslyScrolled()) { - return f->FirstContinuation(); - } - } - } - if ((aFlags & nsLayoutUtils::SCROLLABLE_FIXEDPOS_FINDS_ROOT) && f->StyleDisplay()->mPosition == StylePositionProperty::Fixed && nsLayoutUtils::IsReallyFixedPos(f)) { @@ -1429,10 +1404,6 @@ static nsIFrame* GetNearestScrollableOrOverflowClipFrame( // static ScrollContainerFrame* nsLayoutUtils::GetNearestScrollContainerFrame( nsIFrame* aFrame, uint32_t aFlags) { - // Not suitable to use SCROLLABLE_ONLY_ASRS here because it needs to return - // non-scroll frames. - MOZ_ASSERT(!(aFlags & SCROLLABLE_ONLY_ASRS), - "can't use SCROLLABLE_ONLY_ASRS flag"); nsIFrame* found = GetNearestScrollableOrOverflowClipFrame(aFrame, aFlags); if (!found) { return nullptr; @@ -2666,21 +2637,6 @@ ScrollContainerFrame* nsLayoutUtils::GetAsyncScrollableAncestorFrame( return nsLayoutUtils::GetNearestScrollContainerFrame(aTarget, flags); } -nsIFrame* nsLayoutUtils::GetASRAncestorFrame(nsIFrame* aTarget, - nsDisplayListBuilder* aBuilder) { - MOZ_ASSERT(aBuilder->IsPaintingToWindow()); - // We use different flags from GetAsyncScrollableAncestorFrame above because - // the ASR tree is different from the "async scrollable ancestor chain". We - // don't want SCROLLABLE_ALWAYS_MATCH_ROOT because we only want to match the - // root if it generates an ASR. We don't want SCROLLABLE_FIXEDPOS_FINDS_ROOT - // because the ASR tree does not jump from fixed pos to root (that behaviour - // exists so that fixed pos in the root document in the process can find some - // apzc, ASRs have no such need and that would be incorrect). - // This should be kept in sync with DisplayPortUtils::OneStepInASRChain. - uint32_t flags = nsLayoutUtils::SCROLLABLE_ONLY_ASRS; - return GetNearestScrollableOrOverflowClipFrame(aTarget, flags); -} - void nsLayoutUtils::AddExtraBackgroundItems(nsDisplayListBuilder* aBuilder, nsDisplayList* aList, nsIFrame* aFrame, diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h @@ -603,22 +603,12 @@ class nsLayoutUtils { */ SCROLLABLE_FIXEDPOS_FINDS_ROOT = 0x10, /** - * If the SCROLLABLE_ONLY_ASRS flag is set, then we only want to return - * frames that will generate an ASR. This means that they are either - * scrollable frames for which IsMaybeAsynchronouslyScrolled() returns true - * (aka mWillBuildScrollableLayer == true) or they are sticky position - * frames for which their corresponding scroll frame will generate an ASR. - * This is an internal only flag, you cannot pass it to - * GetNearestScrollContainerFrame since that can only return scroll frames. - */ - SCROLLABLE_ONLY_ASRS = 0x20, - /** * If the SCROLLABLE_STOP_AT_PAGE flag is set, then we stop searching * for scrollable ancestors when seeing a nsPageFrame. This can be used * to avoid finding the viewport scroll frame in Print Preview (which * would be undesirable as a 'position:sticky' container for content). */ - SCROLLABLE_STOP_AT_PAGE = 0x40, + SCROLLABLE_STOP_AT_PAGE = 0x20, }; /** * GetNearestScrollContainerFrame locates the first ancestor of aFrame @@ -2907,28 +2897,6 @@ class nsLayoutUtils { */ static mozilla::ScrollContainerFrame* GetAsyncScrollableAncestorFrame( nsIFrame* aTarget); - /** - * Follows the ASR (ActiveScrolledRoot) chain of frames, so that if - * f is the frame of an ASR A, then calling this function on - * OneStepInASRChain(f) will return the frame of parent ASR of A. Frames that - * generate an ASR are scroll frames for which IsMaybeAsynchronouslyScrolled() - * returns true (aka mWillBuildScrollableLayer == true) or they are sticky - * position frames for which their corresponding scroll frame will generate an - * ASR. This function is different from GetAsyncScrollableAncestorFrame above - * because GetAsyncScrollableAncestorFrame looks only for scroll frames that - * WantAsyncScroll that that function walks from fixed pos to the root scroll - * frame. Because that status (ie mWillBuildScrollableLayer) can change this - * should only be called during a paint to the window after BuildDisplayList - * has been called on aTarget so that mWillBuildScrollableLayer will have been - * updated for this paint already for any frame we need to consult. Or for - * some other reason you know that mWillBuildScrollableLayer is up to date for - * this paint for any frame that might need to be consulted, ie you just - * updated them yourself. Note that a frame returned from this function could - * generate two ASRs: an inner one corresponding to an activated scroll frame, - * and an outer one corresponding to sticky pos. - */ - static nsIFrame* GetASRAncestorFrame(nsIFrame* aTarget, - nsDisplayListBuilder* aBuilder); static void SetBSizeFromFontMetrics( const nsIFrame* aFrame, mozilla::ReflowOutput& aMetrics, diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp @@ -4454,8 +4454,8 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder, MOZ_ASSERT(asr == nullptr); MOZ_ASSERT(aBuilder->IsInViewTransitionCapture()); } else if ((asr ? asr->mFrame : nullptr) != - nsLayoutUtils::GetASRAncestorFrame(child->GetParent(), - aBuilder)) { + DisplayPortUtils::GetASRAncestorFrame(child->GetParent(), + aBuilder)) { // A weird case for native anonymous content in the custom content // container when the root is captured by a view transition. This // content is built outside of the view transition capture but the