| 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 "core/paint/TableSectionPainter.h" | 5 #include "core/paint/TableSectionPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutTableCell.h" | 7 #include "core/layout/LayoutTableCell.h" |
| 8 #include "core/layout/LayoutTableCol.h" | 8 #include "core/layout/LayoutTableCol.h" |
| 9 #include "core/layout/LayoutTableRow.h" | 9 #include "core/layout/LayoutTableRow.h" |
| 10 #include "core/paint/BoxClipper.h" | 10 #include "core/paint/BoxClipper.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 if (dirtiedColumns.start() >= dirtiedColumns.end()) | 185 if (dirtiedColumns.start() >= dirtiedColumns.end()) |
| 186 return; | 186 return; |
| 187 | 187 |
| 188 // Collapsed borders are painted from the bottom right to the top left so that | 188 // Collapsed borders are painted from the bottom right to the top left so that |
| 189 // precedence due to cell position is respected. | 189 // precedence due to cell position is respected. |
| 190 for (unsigned r = dirtiedRows.end(); r > dirtiedRows.start(); r--) { | 190 for (unsigned r = dirtiedRows.end(); r > dirtiedRows.start(); r--) { |
| 191 unsigned row = r - 1; | 191 unsigned row = r - 1; |
| 192 for (unsigned c = dirtiedColumns.end(); c > dirtiedColumns.start(); c--) { | 192 for (unsigned c = dirtiedColumns.end(); c > dirtiedColumns.start(); c--) { |
| 193 unsigned col = c - 1; | 193 unsigned col = c - 1; |
| 194 const LayoutTableSection::CellStruct& current = | 194 const LayoutTableCell* cell = |
| 195 m_layoutTableSection.cellAt(row, col); | 195 m_layoutTableSection.primaryCellAt(row, col); |
| 196 const LayoutTableCell* cell = current.primaryCell(); | |
| 197 if (!cell || (row > dirtiedRows.start() && | 196 if (!cell || (row > dirtiedRows.start() && |
| 198 m_layoutTableSection.primaryCellAt(row - 1, col) == cell) || | 197 m_layoutTableSection.primaryCellAt(row - 1, col) == cell) || |
| 199 (col > dirtiedColumns.start() && | 198 (col > dirtiedColumns.start() && |
| 200 m_layoutTableSection.primaryCellAt(row, col - 1) == cell)) | 199 m_layoutTableSection.primaryCellAt(row, col - 1) == cell)) |
| 201 continue; | 200 continue; |
| 202 LayoutPoint cellPoint = m_layoutTableSection.flipForWritingModeForChild( | 201 LayoutPoint cellPoint = m_layoutTableSection.flipForWritingModeForChild( |
| 203 cell, adjustedPaintOffset); | 202 cell, adjustedPaintOffset); |
| 204 TableCellPainter(*cell).paintCollapsedBorders(paintInfo, cellPoint, | 203 TableCellPainter(*cell).paintCollapsedBorders(paintInfo, cellPoint, |
| 205 currentBorderValue); | 204 currentBorderValue); |
| 206 } | 205 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 HashSet<LayoutTableCell*> spanningCells; | 296 HashSet<LayoutTableCell*> spanningCells; |
| 298 for (unsigned r = dirtiedRows.start(); r < dirtiedRows.end(); r++) { | 297 for (unsigned r = dirtiedRows.start(); r < dirtiedRows.end(); r++) { |
| 299 const LayoutTableRow* row = m_layoutTableSection.rowLayoutObjectAt(r); | 298 const LayoutTableRow* row = m_layoutTableSection.rowLayoutObjectAt(r); |
| 300 // TODO(crbug.com/577282): This painting order is inconsistent with other | 299 // TODO(crbug.com/577282): This painting order is inconsistent with other |
| 301 // outlines. | 300 // outlines. |
| 302 if (row && !row->hasSelfPaintingLayer() && | 301 if (row && !row->hasSelfPaintingLayer() && |
| 303 shouldPaintSelfOutline(paintInfoForDescendants.phase)) | 302 shouldPaintSelfOutline(paintInfoForDescendants.phase)) |
| 304 TableRowPainter(*row).paintOutline(paintInfoForDescendants, | 303 TableRowPainter(*row).paintOutline(paintInfoForDescendants, |
| 305 paintOffset); | 304 paintOffset); |
| 306 for (unsigned c = dirtiedColumns.start(); c < dirtiedColumns.end(); c++) { | 305 for (unsigned c = dirtiedColumns.start(); c < dirtiedColumns.end(); c++) { |
| 306 if (c >= m_layoutTableSection.numCols(r)) |
| 307 break; |
| 307 const LayoutTableSection::CellStruct& current = | 308 const LayoutTableSection::CellStruct& current = |
| 308 m_layoutTableSection.cellAt(r, c); | 309 m_layoutTableSection.cellAt(r, c); |
| 309 for (LayoutTableCell* cell : current.cells) { | 310 for (LayoutTableCell* cell : current.cells) { |
| 310 if (overflowingCells.contains(cell)) | 311 if (overflowingCells.contains(cell)) |
| 311 continue; | 312 continue; |
| 312 if (cell->rowSpan() > 1 || cell->colSpan() > 1) { | 313 if (cell->rowSpan() > 1 || cell->colSpan() > 1) { |
| 313 if (!spanningCells.add(cell).isNewEntry) | 314 if (!spanningCells.add(cell).isNewEntry) |
| 314 continue; | 315 continue; |
| 315 } | 316 } |
| 316 cells.append(cell); | 317 cells.append(cell); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 m_layoutTableSection.styleRef()); | 405 m_layoutTableSection.styleRef()); |
| 405 } else { | 406 } else { |
| 406 // TODO(wangxianzhu): Calculate the inset shadow bounds by insetting | 407 // TODO(wangxianzhu): Calculate the inset shadow bounds by insetting |
| 407 // paintRect by half widths of collapsed borders. | 408 // paintRect by half widths of collapsed borders. |
| 408 BoxPainter::paintInsetBoxShadow(paintInfo, paintRect, | 409 BoxPainter::paintInsetBoxShadow(paintInfo, paintRect, |
| 409 m_layoutTableSection.styleRef()); | 410 m_layoutTableSection.styleRef()); |
| 410 } | 411 } |
| 411 } | 412 } |
| 412 | 413 |
| 413 } // namespace blink | 414 } // namespace blink |
| OLD | NEW |