Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Unified Diff: third_party/WebKit/Source/core/paint/TableSectionPainter.cpp

Issue 2630723002: Fix blink_perf.paint regression about tables (Closed)
Patch Set: Review comments addressed. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698