tor-browser

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

commit fa7b99c25be0aa9dbf68e9f0bec839bfe16a9767
parent 30b207a4d0008aa76afaf9cac865b01837471f0f
Author: Ting-Yu Lin <tlin@mozilla.com>
Date:   Thu,  1 Jan 2026 00:19:35 +0000

Bug 2007602 Part 4 - Fix preparing abspos children for grid container that is a first-in-flow. r=layout-reviewers,emilio

Combining with the patches in bug 1994346, this fixes a crash when running
`testing/web-platform/tests/css/css-break/grid/grid-item-008.html` on CI with
`layout.abspos.fragmentainer-aware-positioning.enabled = true`.

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

Diffstat:
Mlayout/generic/nsGridContainerFrame.cpp | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp @@ -5486,13 +5486,13 @@ void nsGridContainerFrame::Grid::PlaceGridItems( } } - if (aGridRI.mFrame->IsAbsoluteContainer()) { + if (auto* absCB = aGridRI.mFrame->GetAbsoluteContainingBlock(); + absCB && absCB->PrepareAbsoluteFrames(aGridRI.mFrame)) { // 10.1. With a Grid Container as Containing Block // https://drafts.csswg.org/css-grid-2/#abspos-items // We only resolve definite lines here; we'll align auto positions to the // grid container later during reflow. - const nsFrameList& children = - aGridRI.mFrame->GetChildList(aGridRI.mFrame->GetAbsoluteListID()); + const nsFrameList& children = absCB->GetChildList(); const int32_t offsetToColZero = int32_t(mExplicitGridOffsetCol) - 1; const int32_t offsetToRowZero = int32_t(mExplicitGridOffsetRow) - 1; // Untranslate the grid again temporarily while resolving abs.pos. lines. @@ -9308,7 +9308,8 @@ void nsGridContainerFrame::ReflowAbsoluteChildren( nsReflowStatus& aStatus) { WritingMode wm = aGridRI.mReflowInput->GetWritingMode(); auto* absoluteContainer = GetAbsoluteContainingBlock(); - // We have prepared the absolute frames when initializing GridReflowInput. + // We have prepared the absolute frames in Grid::PlaceGridItems() or in + // GridReflowInput::InitializeForContinuation(). if (!absoluteContainer || !absoluteContainer->HasAbsoluteFrames()) { return; }