Bug 1228984 - [css-grid] Auto-placement into columns missed some unoccupied span-1 column slots. r=dholbert

This commit is contained in:
Mats Palmgren 2015-12-02 14:12:24 +01:00
parent 50751f7b3f
commit 148ced7ad0

View File

@ -1534,15 +1534,12 @@ nsGridContainerFrame::FindAutoCol(uint32_t aStartCol, uint32_t aLockedRow,
// Find the first gap in the current row that's at least 'extent' wide.
// ('gap' tracks how wide the current column gap is.)
for (uint32_t j = candidate, gap = 0; j < len && gap < extent; ++j) {
++gap; // tentative, but we may reset it below if a column is occupied
if (cellsInRow[j].mIsOccupied) {
// Optimization: skip as many occupied cells as we can.
do {
++j;
} while (j < len && cellsInRow[j].mIsOccupied);
candidate = j;
gap = 0;
if (!cellsInRow[j].mIsOccupied) {
++gap;
continue;
}
candidate = j + 1;
gap = 0;
}
if (lastCandidate < candidate && i != iStart) {
// Couldn't fit 'extent' tracks at 'lastCandidate' here so we must