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
This commit is contained in:
Mats Palmgren 2016-09-27 17:05:40 +02:00
Родитель 0f91dea2f7
Коммит 9ab65db5db
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -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 &&