summaryrefslogtreecommitdiff
path: root/layout/generic/nsGridContainerFrame.cpp
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2022-04-02 20:22:31 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2022-04-02 23:14:30 +0800
commitf1c2ba75d1067ae2610eacbfae56b7b71ebfa223 (patch)
tree2ee7cd4cd9b69f474b31561e086e911b05765350 /layout/generic/nsGridContainerFrame.cpp
parentf3707e0637314e4e13a240d7cdaf797e709a36e8 (diff)
downloaduxp-f1c2ba75d1067ae2610eacbfae56b7b71ebfa223.tar.gz
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
Diffstat (limited to 'layout/generic/nsGridContainerFrame.cpp')
-rw-r--r--layout/generic/nsGridContainerFrame.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp
index f3904094db..0a953d6fff 100644
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -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));