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

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

Issue 1584903002: Improvement handling of background and outline paint phases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PaintPhaseRename
Patch Set: Fix TablePainter and TableRowPainter Created 4 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/TableRowPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/TableRowPainter.cpp b/third_party/WebKit/Source/core/paint/TableRowPainter.cpp
index 8afa7ab3f8bdc8486beda761749173b21563100b..b249ca929cc002e16f6c4c1830ecbda7f794e9f5 100644
--- a/third_party/WebKit/Source/core/paint/TableRowPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/TableRowPainter.cpp
@@ -17,23 +17,33 @@ void TableRowPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
{
ASSERT(m_layoutTableRow.hasSelfPaintingLayer());
+ // Table rows don't paint self background. The cells paint table section's background
+ // behind them when needed during PaintPhaseBlockBackground or PaintPhaseDescendantBlockBackgroundOnly.
+ if (paintInfo.phase == PaintPhaseSelfBlockBackgroundOnly)
+ return;
+
+ // TODO(wangxianzhu): This painting order is inconsistent with other outlines. crbug.com/577282.
paintOutlineForRowIfNeeded(paintInfo, paintOffset);
+ if (paintInfo.phase == PaintPhaseSelfOutlineOnly)
+ return;
+
+ PaintInfo paintInfoForCells = paintInfo.forDescendants();
for (LayoutTableCell* cell = m_layoutTableRow.firstCell(); cell; cell = cell->nextCell()) {
// Paint the row background behind the cell.
- if (paintInfo.phase == PaintPhaseSelfBlockBackground || paintInfo.phase == PaintPhaseBlockBackground) {
+ if (shouldPaintSelfBlockBackground(paintInfoForCells.phase)) {
if (m_layoutTableRow.hasBackground())
- TableCellPainter(*cell).paintBackgroundsBehindCell(paintInfo, paintOffset, &m_layoutTableRow, DisplayItem::TableCellBackgroundFromRow);
+ TableCellPainter(*cell).paintBackgroundsBehindCell(paintInfoForCells, paintOffset, &m_layoutTableRow, DisplayItem::TableCellBackgroundFromRow);
}
if (!cell->hasSelfPaintingLayer())
- cell->paint(paintInfo, paintOffset);
+ cell->paint(paintInfoForCells, paintOffset);
}
}
void TableRowPainter::paintOutlineForRowIfNeeded(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
PaintPhase paintPhase = paintInfo.phase;
- if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && m_layoutTableRow.style()->visibility() == VISIBLE) {
+ if (shouldPaintSelfOutline(paintPhase)) {
LayoutPoint adjustedPaintOffset = paintOffset + m_layoutTableRow.location();
ObjectPainter(m_layoutTableRow).paintOutline(paintInfo, adjustedPaintOffset);
}

Powered by Google App Engine
This is Rietveld 408576698