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

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

Issue 1312493007: Fix table cell background caching issue about interest rect (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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: Source/core/paint/TableSectionPainter.cpp
diff --git a/Source/core/paint/TableSectionPainter.cpp b/Source/core/paint/TableSectionPainter.cpp
index 62b011aa28d554797ff2f98be1f70545332b95e4..b4d3bf5471a5ebf8b8af1b7231a375772b32da78 100644
--- a/Source/core/paint/TableSectionPainter.cpp
+++ b/Source/core/paint/TableSectionPainter.cpp
@@ -9,6 +9,7 @@
#include "core/layout/LayoutTableCell.h"
#include "core/layout/LayoutTableCol.h"
#include "core/layout/LayoutTableRow.h"
+#include "core/paint/BlockPainter.h"
#include "core/paint/BoxClipper.h"
#include "core/paint/LayoutObjectDrawingRecorder.h"
#include "core/paint/ObjectPainter.h"
@@ -160,7 +161,8 @@ void TableSectionPainter::paintCell(LayoutTableCell* cell, const PaintInfo& pain
PaintPhase paintPhase = paintInfo.phase;
LayoutTableRow* row = toLayoutTableRow(cell->parent());
- if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) {
+ if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground)
+ && BlockPainter(*cell).isVisibleInPaintRect(paintInfo, paintOffset)) {
// We need to handle painting a stack of backgrounds. This stack (from bottom to top) consists of
// the column group, column, row group, row, and then the cell.
LayoutTableCol* column = m_layoutTableSection.table()->colElement(cell->col());
@@ -173,8 +175,8 @@ void TableSectionPainter::paintCell(LayoutTableCell* cell, const PaintInfo& pain
if (columnHasBackground || columnGroupHasBackground || sectionHasBackground || rowHasBackground) {
TableCellPainter tableCellPainter(*cell);
- if (!LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, *cell, paintPhase, paintOffset)) {
- LayoutObjectDrawingRecorder recorder(*paintInfo.context, *cell, paintPhase, tableCellPainter.paintBounds(cellPoint, TableCellPainter::AddOffsetFromParent), paintOffset);
+ if (!LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, *cell, DisplayItem::TableCellBackgroundFromContainers, paintOffset)) {
+ LayoutObjectDrawingRecorder recorder(*paintInfo.context, *cell, DisplayItem::TableCellBackgroundFromContainers, tableCellPainter.paintBounds(cellPoint, TableCellPainter::AddOffsetFromParent), paintOffset);
// Column groups and columns first.
// FIXME: Columns and column groups do not currently support opacity, and they are being painted "too late" in
// the stack, since we have already opened a transparency layer (potentially) for the table row group.

Powered by Google App Engine
This is Rietveld 408576698