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

Side by Side Diff: third_party/WebKit/Source/core/paint/TableSectionPainter.cpp

Issue 1819073004: Fix table cell background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cr fixes, remove tiling algorithm Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/TableSectionPainter.h" 5 #include "core/paint/TableSectionPainter.h"
6 6
7 #include "core/layout/LayoutTable.h" 7 #include "core/layout/LayoutTable.h"
8 #include "core/layout/LayoutTableCell.h" 8 #include "core/layout/LayoutTableCell.h"
9 #include "core/layout/LayoutTableCol.h" 9 #include "core/layout/LayoutTableCol.h"
10 #include "core/layout/LayoutTableRow.h" 10 #include "core/layout/LayoutTableRow.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 LayoutTableCol* column = colAndColGroup.col; 189 LayoutTableCol* column = colAndColGroup.col;
190 LayoutTableCol* columnGroup = colAndColGroup.colgroup; 190 LayoutTableCol* columnGroup = colAndColGroup.colgroup;
191 TableCellPainter tableCellPainter(cell); 191 TableCellPainter tableCellPainter(cell);
192 192
193 // Column groups and columns first. 193 // Column groups and columns first.
194 // FIXME: Columns and column groups do not currently support opacity, an d they are being painted "too late" in 194 // FIXME: Columns and column groups do not currently support opacity, an d they are being painted "too late" in
195 // the stack, since we have already opened a transparency layer (potenti ally) for the table row group. 195 // the stack, since we have already opened a transparency layer (potenti ally) for the table row group.
196 // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the 196 // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the
197 // cell. 197 // cell.
198 if (columnGroup && columnGroup->hasBackground()) 198 if (columnGroup && columnGroup->hasBackground())
199 tableCellPainter.paintBackgroundsBehindCell(paintInfoForCells, cellP oint, columnGroup, DisplayItem::TableCellBackgroundFromColumnGroup); 199 tableCellPainter.paintBackgroundsBehindCell(paintInfoForCells, cellP oint, *columnGroup, DisplayItem::TableCellBackgroundFromColumnGroup);
200 if (column && column->hasBackground()) 200 if (column && column->hasBackground())
201 tableCellPainter.paintBackgroundsBehindCell(paintInfoForCells, cellP oint, column, DisplayItem::TableCellBackgroundFromColumn); 201 tableCellPainter.paintBackgroundsBehindCell(paintInfoForCells, cellP oint, *column, DisplayItem::TableCellBackgroundFromColumn);
202 202
203 // Paint the row group next. 203 // Paint the row group next.
204 if (m_layoutTableSection.hasBackground()) 204 if (m_layoutTableSection.hasBackground())
205 tableCellPainter.paintBackgroundsBehindCell(paintInfoForCells, cellP oint, &m_layoutTableSection, DisplayItem::TableCellBackgroundFromSection); 205 tableCellPainter.paintBackgroundsBehindCell(paintInfoForCells, cellP oint, m_layoutTableSection, DisplayItem::TableCellBackgroundFromSection);
206 } 206 }
207 207
208 if (shouldPaintDescendantBlockBackgrounds(originalPaintPhase)) { 208 if (shouldPaintDescendantBlockBackgrounds(originalPaintPhase)) {
209 // Paint the row next, but only if it doesn't have a layer. If a row has a layer, it will be responsible for 209 // Paint the row next, but only if it doesn't have a layer. If a row has a layer, it will be responsible for
210 // painting the row background for the cell. 210 // painting the row background for the cell.
211 if (row->hasBackground() && !row->hasSelfPaintingLayer()) 211 if (row->hasBackground() && !row->hasSelfPaintingLayer())
212 TableCellPainter(cell).paintBackgroundsBehindCell(paintInfoForCells, cellPoint, row, DisplayItem::TableCellBackgroundFromRow); 212 TableCellPainter(cell).paintBackgroundsBehindCell(paintInfoForCells, cellPoint, *row, DisplayItem::TableCellBackgroundFromRow);
213 } 213 }
214 214
215 if (originalPaintPhase != PaintPhaseSelfBlockBackgroundOnly && !cell.hasSelf PaintingLayer() && !row->hasSelfPaintingLayer()) 215 if (originalPaintPhase != PaintPhaseSelfBlockBackgroundOnly && !cell.hasSelf PaintingLayer() && !row->hasSelfPaintingLayer())
216 cell.paint(paintInfoForCells, cellPoint); 216 cell.paint(paintInfoForCells, cellPoint);
217 } 217 }
218 218
219 } // namespace blink 219 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/TableRowPainter.cpp ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698