From 9ab65db5db84bb94c99727e89f806d0bb2a9d001 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Tue, 27 Sep 2016 17:05:40 +0200 Subject: [PATCH] Bug 1255393 part 3 - [css-grid] Update 'auto' min track sizing for span=1 to the latest Grid spec. r=dholbert Now it returns the min/max-content contribution for intrinsic sizing. Otherwise, i.e. during Reflow, return the min-size contribution. (Previously, it always returned the min-size contribution.) https://drafts.csswg.org/css-grid/#algo-content --- layout/generic/nsGridContainerFrame.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 8927c46461d8..ee61aa66bf35 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -3781,7 +3781,15 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSizeStep1( WritingMode wm = aState.mWM; nsRenderingContext* rc = &aState.mRenderingContext; if (sz.mState & TrackSize::eAutoMinSizing) { - nscoord s = MinSize(aGridItem, aState, rc, wm, mAxis); + nscoord s; + if (aConstraint == SizingConstraint::eMinContent) { + s = MinContentContribution(aGridItem, aState, rc, wm, mAxis); + } else if (aConstraint == SizingConstraint::eMaxContent) { + s = MaxContentContribution(aGridItem, aState, rc, wm, mAxis); + } else { + MOZ_ASSERT(aConstraint == SizingConstraint::eNoConstraint); + s = MinSize(aGridItem, aState, rc, wm, mAxis); + } sz.mBase = std::max(sz.mBase, s); } else if ((sz.mState & TrackSize::eMinContentMinSizing) || (aConstraint == SizingConstraint::eMinContent &&