Bug 1986191. Work around a null mScrollContainerFrame in an active scrolled root. a=RyanVM

We should not have a null mScrollContainerFrame in an asr that is in use, but we are getting crashes in bug 1764863 that show that this is happening at volume. We have not been successful over a long period of time of finding a testcase or some way to reproduce. We have a landed patch in bug 1984898 (based on a pernosco of one instance of this from a few years back) that we hope fixes some or most of these. The patch in bug 1984898 is a little bit big, and we have no evidence that it fixes the problem. So I am proposing this patch as something we can uplift that should work around the problem. We still want to fix any instances of that this we come across so the MOZ_DIAGNOSTIC_ASSERT will fire in nightly and early beta builds. The gfxCriticalNoteOnce will alert us if this is having negative consequences later on.

By returning false we will abort the partial display list update and delete the retained display list that contains an asr that has a null mScrollContainerFrame and we will do a full rebuild. This should avoid the problem and be much better than crashing.

Original Revision: https://phabricator.services.mozilla.com/D263224

Differential Revision: https://phabricator.services.mozilla.com/D263820
This commit is contained in:
Timothy Nikkel
2025-09-05 01:43:40 +00:00
committed by rvandermeulen@mozilla.com
parent 1c0eec2481
commit a6603c3ef3

View File

@@ -305,8 +305,14 @@ bool RetainedDisplayListBuilder::PreProcessDisplayList(
!item->GetActiveScrolledRoot()) {
agrFrame = aAsyncAncestor;
} else {
agrFrame = item->GetActiveScrolledRoot()
->mScrollContainerFrame->GetScrolledFrame();
auto* scrollContainerFrame =
item->GetActiveScrolledRoot()->mScrollContainerFrame;
if (MOZ_UNLIKELY(!scrollContainerFrame)) {
MOZ_DIAGNOSTIC_ASSERT(false);
gfxCriticalNoteOnce << "Found null mScrollContainerFrame in asr";
return false;
}
agrFrame = scrollContainerFrame->GetScrolledFrame();
}
if (aAGR && agrFrame != aAGR) {