tor-browser

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

commit 2f990aab82f1973c1168a56b6c51fc229d1604f3
parent a22fae43e3022fe93b695b8931343cfb8139262c
Author: Botond Ballo <botond@mozilla.com>
Date:   Tue, 25 Nov 2025 04:50:44 +0000

Bug 2001862 - Relax the assumptions made by SetCurrentActiveScroledRoot(). r=mstange

The code previously assumed that the incoming ASR and the
mContentClipASR must have an ancestor-descendant relationship,
 but there are legitimate counterexamples to this.

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

Diffstat:
Mlayout/painting/nsDisplayList.cpp | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp @@ -537,11 +537,14 @@ void nsDisplayListBuilder::AutoCurrentActiveScrolledRootSetter:: // finiteBoundsASR is the leafmost ASR that all items created during // object's lifetime have finite bounds with respect to. - const ActiveScrolledRoot* finiteBoundsASR = - mBuilder->IsInViewTransitionCapture() - ? aActiveScrolledRoot - : ActiveScrolledRoot::PickDescendant(mContentClipASR, - aActiveScrolledRoot); + // TODO(bug 2001862): Explanation may need revising. + const ActiveScrolledRoot* finiteBoundsASR = aActiveScrolledRoot; + if (!mBuilder->IsInViewTransitionCapture()) { + finiteBoundsASR = + ActiveScrolledRoot::IsAncestor(aActiveScrolledRoot, mContentClipASR) + ? mContentClipASR + : aActiveScrolledRoot; + } // mCurrentContainerASR is adjusted so that it's still an ancestor of // finiteBoundsASR.