Bug 1267555 part 1 - [css-grid] Make grid-aligned abs.pos. descendants that span from 'auto' to the first/last line stretch to the outer edge of the first/last track respectively. r=dholbert

This commit is contained in:
Mats Palmgren 2016-04-28 21:21:19 +02:00
Родитель aa8be126c7
Коммит 5ed9f29039
1 изменённых файлов: 6 добавлений и 3 удалений

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

@ -4022,14 +4022,17 @@ nsGridContainerFrame::LineRange::ToPositionAndLengthForAbsPos(
// done
} else {
const nscoord endPos = *aPos + *aLength;
nscoord startPos =
aTracks.GridLineEdge(mStart, GridLineSide::eAfterGridGap);
auto side = mStart == aTracks.mSizes.Length() ? GridLineSide::eBeforeGridGap
: GridLineSide::eAfterGridGap;
nscoord startPos = aTracks.GridLineEdge(mStart, side);
*aPos = aGridOrigin + startPos;
*aLength = std::max(endPos - *aPos, 0);
}
} else {
if (mStart == kAutoLine) {
nscoord endPos = aTracks.GridLineEdge(mEnd, GridLineSide::eBeforeGridGap);
auto side = mEnd == 0 ? GridLineSide::eAfterGridGap
: GridLineSide::eBeforeGridGap;
nscoord endPos = aTracks.GridLineEdge(mEnd, side);
*aLength = std::max(aGridOrigin + endPos, 0);
} else {
nscoord pos;