Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/TableSectionPainter.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp |
| index 983c3269d84e5f4ad5eb2fdbfbbf8bf57effaefd..6e78a95a0f6dcd10fccad2f05308b3ac71274d6f 100644 |
| --- a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp |
| @@ -189,8 +189,11 @@ void TableSectionPainter::paintCollapsedSectionBorders( |
| // precedence due to cell position is respected. |
| for (unsigned r = dirtiedRows.end(); r > dirtiedRows.start(); r--) { |
| unsigned row = r - 1; |
| + unsigned nCols = m_layoutTableSection.numCols(row); |
| for (unsigned c = dirtiedColumns.end(); c > dirtiedColumns.start(); c--) { |
|
mstensho (USE GERRIT)
2017/01/23 09:24:57
unsigned c = std::min(dirtiedColumns.end(), nCols)
a.suchit
2017/01/23 11:19:01
Done.
|
| unsigned col = c - 1; |
| + if (col >= nCols) |
| + continue; |
| const LayoutTableCell* cell = |
| m_layoutTableSection.primaryCellAt(row, col); |
| if (!cell || (row > dirtiedRows.start() && |
| @@ -302,9 +305,9 @@ void TableSectionPainter::paintObject(const PaintInfo& paintInfo, |
| shouldPaintSelfOutline(paintInfoForDescendants.phase)) |
| TableRowPainter(*row).paintOutline(paintInfoForDescendants, |
| paintOffset); |
| - for (unsigned c = dirtiedColumns.start(); c < dirtiedColumns.end(); c++) { |
| - if (c >= m_layoutTableSection.numCols(r)) |
| - break; |
| + unsigned nCols = m_layoutTableSection.numCols(r); |
| + for (unsigned c = dirtiedColumns.start(); |
| + c < nCols && c < dirtiedColumns.end(); c++) { |
| const LayoutTableSection::CellStruct& current = |
| m_layoutTableSection.cellAt(r, c); |
| for (LayoutTableCell* cell : current.cells) { |