Issue #1838 - Part 6: Re-resolve row-gap against the sum of row track sizes for auto-sized grid containers

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1458902
This commit is contained in:
FranklinDM 2022-04-02 20:22:31 +08:00 committed by roytam1
commit 5800b95cd0

View file

@ -6214,6 +6214,11 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
computedISize, bSize);
if (!prevInFlow) {
if (computedBSize == NS_AUTOHEIGHT && stylePos->mRowGap.HasPercent()) {
// Re-resolve the row-gap now that we know our intrinsic block-size.
gridReflowInput.mRows.mGridGap =
nsLayoutUtils::ResolveGapToLength(stylePos->mRowGap, bSize);
}
// Apply 'align/justify-content' to the grid.
// CalculateTrackSizes did the columns.
gridReflowInput.mRows.AlignJustifyContent(stylePos, wm, contentArea.Size(wm));