diff options
Diffstat (limited to 'layout/generic/nsGridContainerFrame.cpp')
-rw-r--r-- | layout/generic/nsGridContainerFrame.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 59f58f268..054f01297 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -725,9 +725,6 @@ struct nsGridContainerFrame::LineRange mEnd > mStart, "invalid line range"); mEnd -= aNumRemovedTracks[mEnd]; } - if (mStart == mEnd) { - mEnd = nsGridContainerFrame::kAutoLine; - } } /** * Return the contribution of this line range for step 2 in @@ -5179,10 +5176,15 @@ nsGridContainerFrame::LineRange::ToPositionAndLengthForAbsPos( : GridLineSide::eBeforeGridGap; nscoord endPos = aTracks.GridLineEdge(mEnd, side); *aLength = std::max(aGridOrigin + endPos, 0); - } else { + } else if (MOZ_LIKELY(mStart != mEnd)) { nscoord pos; ToPositionAndLength(aTracks.mSizes, &pos, aLength); *aPos = aGridOrigin + pos; + } else { + // The grid area only covers removed 'auto-fit' tracks. + nscoord pos = aTracks.GridLineEdge(mStart, GridLineSide::eBeforeGridGap); + *aPos = aGridOrigin + pos; + *aLength = nscoord(0); } } } |