Bug 1458902 - [css-grid] Re-resolve row-gap against the sum of row track sizes for auto-sized grid containers. r=dholbert

Per CSSWG resolution in:
https://github.com/w3c/csswg-drafts/issues/1921#issuecomment-342269371
This commit is contained in:
Mats Palmgren 2018-05-18 21:09:21 +02:00
parent abedb6c83d
commit 32dff95bd8

View File

@ -5990,6 +5990,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));