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

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

Issue 2783953002: Fix spanning cell painting background from wrong row (Closed)
Patch Set: Remove non-const version and use faster implementation Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/TableSectionPainter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0e450432421f36d23b03380020f25e0fcbbec378..de40383390836b5c3a33ca986e192270964c068f 100644
--- a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
@@ -18,28 +18,6 @@
namespace blink {
-inline const LayoutTableCell* TableSectionPainter::primaryCellToPaint(
- unsigned row,
- unsigned column,
- const CellSpan& dirtiedRows,
- const CellSpan& dirtiedColumns) const {
- DCHECK(row >= dirtiedRows.start() && row < dirtiedRows.end());
- DCHECK(column >= dirtiedColumns.start() && column < dirtiedColumns.end());
-
- const LayoutTableCell* cell = m_layoutTableSection.primaryCellAt(row, column);
- if (!cell)
- return nullptr;
- // We have painted (row, column) when painting (row - 1, column).
- if (row > dirtiedRows.start() &&
- m_layoutTableSection.primaryCellAt(row - 1, column) == cell)
- return nullptr;
- // We have painted (row, column) when painting (row, column -1).
- if (column > dirtiedColumns.start() &&
- m_layoutTableSection.primaryCellAt(row, column - 1) == cell)
- return nullptr;
- return cell;
-}
-
void TableSectionPainter::paintRepeatingHeaderGroup(
const PaintInfo& paintInfo,
const LayoutPoint& paintOffset,
@@ -193,17 +171,13 @@ void TableSectionPainter::paintCollapsedSectionBorders(
for (unsigned c = std::min(dirtiedColumns.end(), nCols);
c > dirtiedColumns.start(); c--) {
unsigned col = c - 1;
- const LayoutTableCell* cell =
- m_layoutTableSection.primaryCellAt(row, col);
- if (!cell || (row > dirtiedRows.start() &&
- m_layoutTableSection.primaryCellAt(row - 1, col) == cell) ||
- (col > dirtiedColumns.start() &&
- m_layoutTableSection.primaryCellAt(row, col - 1) == cell))
- continue;
- LayoutPoint cellPoint = m_layoutTableSection.flipForWritingModeForChild(
- cell, adjustedPaintOffset);
- TableCellPainter(*cell).paintCollapsedBorders(paintInfo, cellPoint,
- currentBorderValue);
+ if (const LayoutTableCell* cell =
+ m_layoutTableSection.originatingCellAt(row, col)) {
+ LayoutPoint cellPoint = m_layoutTableSection.flipForWritingModeForChild(
+ cell, adjustedPaintOffset);
+ TableCellPainter(*cell).paintCollapsedBorders(paintInfo, cellPoint,
+ currentBorderValue);
+ }
}
}
}
@@ -231,9 +205,10 @@ void TableSectionPainter::paintObject(const PaintInfo& paintInfo,
for (unsigned r = dirtiedRows.start(); r < dirtiedRows.end(); r++) {
for (unsigned c = dirtiedColumns.start(); c < dirtiedColumns.end(); c++) {
if (const LayoutTableCell* cell =
- primaryCellToPaint(r, c, dirtiedRows, dirtiedColumns))
+ m_layoutTableSection.originatingCellAt(r, c)) {
paintBackgroundsBehindCell(*cell, paintInfoForDescendants,
paintOffset);
+ }
}
}
paintBoxShadow(paintInfo, paintOffset, Inset);
@@ -255,9 +230,10 @@ void TableSectionPainter::paintObject(const PaintInfo& paintInfo,
for (unsigned c = dirtiedColumns.start(); c < dirtiedColumns.end();
c++) {
if (const LayoutTableCell* cell =
- primaryCellToPaint(r, c, dirtiedRows, dirtiedColumns))
+ m_layoutTableSection.originatingCellAt(r, c)) {
rowPainter.paintBackgroundBehindCell(*cell, paintInfoForDescendants,
paintOffset);
+ }
}
}
rowPainter.paintBoxShadow(paintInfoForDescendants, paintOffset, Inset);
@@ -278,7 +254,7 @@ void TableSectionPainter::paintObject(const PaintInfo& paintInfo,
paintOffset);
for (unsigned c = dirtiedColumns.start(); c < dirtiedColumns.end(); c++) {
if (const LayoutTableCell* cell =
- primaryCellToPaint(r, c, dirtiedRows, dirtiedColumns))
+ m_layoutTableSection.originatingCellAt(r, c))
paintCell(*cell, paintInfoForDescendants, paintOffset);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/TableSectionPainter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698