Bug 1237754 part 1 - [css-grid][css-align] Make 'align-content:normal' behave as 'stretch' for Grid containers. r=dholbert

Change due to CSSWG decision:
https://lists.w3.org/Archives/Public/www-style/2016Jan/0031.html
This commit is contained in:
Mats Palmgren 2016-01-17 19:44:05 +01:00
Родитель 0d1f6a74d4
Коммит 36a12be95a
1 изменённых файлов: 6 добавлений и 4 удалений

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

@ -2936,15 +2936,17 @@ nsGridContainerFrame::Tracks::AlignJustifyContent(
const bool isAlign = mAxis == eLogicalAxisBlock; const bool isAlign = mAxis == eLogicalAxisBlock;
auto stylePos = aReflowState.mStylePosition; auto stylePos = aReflowState.mStylePosition;
const auto valueAndFallback = isAlign ? auto valueAndFallback = isAlign ? stylePos->ComputedAlignContent() :
stylePos->ComputedAlignContent() : stylePos->ComputedJustifyContent();
stylePos->ComputedJustifyContent();
WritingMode wm = aReflowState.GetWritingMode(); WritingMode wm = aReflowState.GetWritingMode();
bool overflowSafe; bool overflowSafe;
auto alignment = ::GetAlignJustifyValue(valueAndFallback, wm, isAlign, auto alignment = ::GetAlignJustifyValue(valueAndFallback, wm, isAlign,
&overflowSafe); &overflowSafe);
if (alignment == NS_STYLE_ALIGN_NORMAL) { if (alignment == NS_STYLE_ALIGN_NORMAL) {
alignment = NS_STYLE_ALIGN_START; MOZ_ASSERT(valueAndFallback == NS_STYLE_ALIGN_NORMAL,
"*-content:normal cannot be specified with explicit fallback");
alignment = isAlign ? NS_STYLE_ALIGN_STRETCH : NS_STYLE_ALIGN_START;
valueAndFallback = alignment; // we may need a fallback for 'stretch' below
} }
// Compute the free space and count auto-sized tracks. // Compute the free space and count auto-sized tracks.