Bug 1720618 - Remove redundant checks from nsTableFrame::ExpandBCDamageArea. r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D119935
This commit is contained in:
Alex Henrie 2021-07-19 21:45:45 +00:00
Родитель 094d5b88a8
Коммит 2610b8861a
1 изменённых файлов: 17 добавлений и 14 удалений

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

@ -4934,8 +4934,8 @@ void nsTableFrame::ExpandBCDamageArea(TableArea& aArea) const {
} }
} }
// check for spanners on the left and right // check for spanners on the left and right
int32_t iterStartY = -1; int32_t iterStartY;
int32_t iterEndY = -1; int32_t iterEndY;
if ((dStartY >= rgStartY) && (dStartY <= rgEndY)) { if ((dStartY >= rgStartY) && (dStartY <= rgEndY)) {
// the damage area starts in the row group // the damage area starts in the row group
iterStartY = dStartY; iterStartY = dStartY;
@ -4948,23 +4948,26 @@ void nsTableFrame::ExpandBCDamageArea(TableArea& aArea) const {
// the damage area contains the row group // the damage area contains the row group
iterStartY = rgStartY; iterStartY = rgStartY;
iterEndY = rgEndY; iterEndY = rgEndY;
} else {
// the damage area does not overlap the row group
continue;
} }
if ((iterStartY >= 0) && (iterEndY >= 0)) { NS_ASSERTION(iterStartY >= 0 && iterEndY >= 0,
for (int32_t y = iterStartY; y <= iterEndY; y++) { "table index values are expected to be nonnegative");
if (uint32_t(y - rgStartY) >= cellMap->mRows.Length()) ABORT0(); for (int32_t y = iterStartY; y <= iterEndY; y++) {
const nsCellMap::CellDataArray& row = cellMap->mRows[y - rgStartY]; if (uint32_t(y - rgStartY) >= cellMap->mRows.Length()) ABORT0();
CellData* cellData = row.SafeElementAt(dStartX); const nsCellMap::CellDataArray& row = cellMap->mRows[y - rgStartY];
CellData* cellData = row.SafeElementAt(dStartX);
if (cellData && (cellData->IsColSpan())) {
haveSpanner = true;
break;
}
if (dEndX < (numCols - 1)) {
cellData = row.SafeElementAt(dEndX + 1);
if (cellData && (cellData->IsColSpan())) { if (cellData && (cellData->IsColSpan())) {
haveSpanner = true; haveSpanner = true;
break; break;
} }
if (dEndX < (numCols - 1)) {
cellData = row.SafeElementAt(dEndX + 1);
if (cellData && (cellData->IsColSpan())) {
haveSpanner = true;
break;
}
}
} }
} }
} }