OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 #include "core/paint/TableSectionPainter.h" | 6 #include "core/paint/TableSectionPainter.h" |
7 | 7 |
8 #include "core/layout/LayoutTable.h" | 8 #include "core/layout/LayoutTable.h" |
9 #include "core/layout/LayoutTableCell.h" | 9 #include "core/layout/LayoutTableCell.h" |
10 #include "core/layout/LayoutTableCol.h" | 10 #include "core/layout/LayoutTableCol.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void TableSectionPainter::paintObject(const PaintInfo& paintInfo, const LayoutPo
int& paintOffset) | 62 void TableSectionPainter::paintObject(const PaintInfo& paintInfo, const LayoutPo
int& paintOffset) |
63 { | 63 { |
64 LayoutRect localPaintInvalidationRect = paintInfo.rect; | 64 LayoutRect localPaintInvalidationRect = paintInfo.rect; |
65 localPaintInvalidationRect.moveBy(-paintOffset); | 65 localPaintInvalidationRect.moveBy(-paintOffset); |
66 | 66 |
67 LayoutRect tableAlignedRect = m_layoutTableSection.logicalRectForWritingMode
AndDirection(localPaintInvalidationRect); | 67 LayoutRect tableAlignedRect = m_layoutTableSection.logicalRectForWritingMode
AndDirection(localPaintInvalidationRect); |
68 | 68 |
69 CellSpan dirtiedRows = m_layoutTableSection.dirtiedRows(tableAlignedRect); | 69 CellSpan dirtiedRows = m_layoutTableSection.dirtiedRows(tableAlignedRect); |
70 CellSpan dirtiedColumns = m_layoutTableSection.dirtiedColumns(tableAlignedRe
ct); | 70 CellSpan dirtiedColumns = m_layoutTableSection.dirtiedColumns(tableAlignedRe
ct); |
71 | 71 |
72 WillBeHeapHashSet<RawPtrWillBeMember<LayoutTableCell> > overflowingCells = m
_layoutTableSection.overflowingCells(); | 72 HashSet<LayoutTableCell*> overflowingCells = m_layoutTableSection.overflowin
gCells(); |
73 if (dirtiedColumns.start() < dirtiedColumns.end()) { | 73 if (dirtiedColumns.start() < dirtiedColumns.end()) { |
74 if (!m_layoutTableSection.hasMultipleCellLevels() && !overflowingCells.s
ize()) { | 74 if (!m_layoutTableSection.hasMultipleCellLevels() && !overflowingCells.s
ize()) { |
75 if (paintInfo.phase == PaintPhaseCollapsedTableBorders) { | 75 if (paintInfo.phase == PaintPhaseCollapsedTableBorders) { |
76 // Collapsed borders are painted from the bottom right to the to
p left so that precedence | 76 // Collapsed borders are painted from the bottom right to the to
p left so that precedence |
77 // due to cell position is respected. | 77 // due to cell position is respected. |
78 for (unsigned r = dirtiedRows.end(); r > dirtiedRows.start(); r-
-) { | 78 for (unsigned r = dirtiedRows.end(); r > dirtiedRows.start(); r-
-) { |
79 unsigned row = r - 1; | 79 unsigned row = r - 1; |
80 for (unsigned c = dirtiedColumns.end(); c > dirtiedColumns.s
tart(); c--) { | 80 for (unsigned c = dirtiedColumns.end(); c > dirtiedColumns.s
tart(); c--) { |
81 unsigned col = c - 1; | 81 unsigned col = c - 1; |
82 LayoutTableSection::CellStruct& current = m_layoutTableS
ection.cellAt(row, col); | 82 LayoutTableSection::CellStruct& current = m_layoutTableS
ection.cellAt(row, col); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // painting the row background for the cell. | 188 // painting the row background for the cell. |
189 if (!row->hasSelfPaintingLayer()) | 189 if (!row->hasSelfPaintingLayer()) |
190 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint
, row); | 190 tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint
, row); |
191 } | 191 } |
192 } | 192 } |
193 if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer())) | 193 if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer())) |
194 cell->paint(paintInfo, cellPoint); | 194 cell->paint(paintInfo, cellPoint); |
195 } | 195 } |
196 | 196 |
197 } // namespace blink | 197 } // namespace blink |
OLD | NEW |