tor-browser

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

commit 5f678e051c20d0f719ab659ecfad7365d4a32cab
parent dc427a77927d00eedc1db7e0bea5378fd8b24cd4
Author: Timothy Nikkel <tnikkel@gmail.com>
Date:   Thu, 13 Nov 2025 02:22:24 +0000

Bug 1999504. Fix inconsistency with couldBuildLayer in ScrollContainerFrame::BuildDisplayList. r=hiro,layout-reviewers

We use couldBuildLayer in two places, to set the scroll parent id

https://searchfox.org/firefox-main/rev/931471037b8a4f16ce3ccfa864310540cac255c1/layout/generic/ScrollContainerFrame.cpp#4003

and to add hit test info so that we can activate scroll frames that are currently inactive but could become active

https://searchfox.org/firefox-main/rev/931471037b8a4f16ce3ccfa864310540cac255c1/layout/generic/ScrollContainerFrame.cpp#4172

The reason that we have the IsVisible check is from bug 1673505 where a visibility: hidden scroll frame that was not active (but could be active) in the root content process was getting all events, and so the events were being sent to the root content process, but the events needed to be sent to an OOP iframe (fission). So it only cares about the second place, so we can move the IsVisible check to the second use of couldBuildLayer without regressing that bug. Furthermore, since that time we've decided that we need to activate all scroll frames for fission to make sure that events are routed to the correct process, so that situation would not even arise anymore.

Having the IsVisible check for setting th scroll parent id could potentially lead to inconsistency since no where else does IsVisible determine if something can be a scroll parent and/or be active.

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

Diffstat:
Mlayout/generic/ScrollContainerFrame.cpp | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/layout/generic/ScrollContainerFrame.cpp b/layout/generic/ScrollContainerFrame.cpp @@ -3860,8 +3860,7 @@ void ScrollContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, if (mWillBuildScrollableLayer) { return true; } - return StyleVisibility()->IsVisible() && - nsLayoutUtils::AsyncPanZoomEnabled(this) && WantAsyncScroll(); + return nsLayoutUtils::AsyncPanZoomEnabled(this) && WantAsyncScroll(); }(); // Now display the scrollbars and scrollcorner. These parts are drawn @@ -4123,7 +4122,7 @@ void ScrollContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, } } - if (couldBuildLayer) { + if (couldBuildLayer & StyleVisibility()->IsVisible()) { CompositorHitTestInfo info(CompositorHitTestFlags::eVisibleToHitTest, CompositorHitTestFlags::eInactiveScrollframe); // If the scroll frame has non-default overscroll-behavior, instruct