| 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 19 matching lines...) Expand all Loading... |
| 30 if (row > dirtiedRows.start() && m_layoutTableSection.primaryCellAt(row - 1,
column) == cell) | 30 if (row > dirtiedRows.start() && m_layoutTableSection.primaryCellAt(row - 1,
column) == cell) |
| 31 return nullptr; | 31 return nullptr; |
| 32 // We have painted (row, column) when painting (row, column -1). | 32 // We have painted (row, column) when painting (row, column -1). |
| 33 if (column > dirtiedColumns.start() && m_layoutTableSection.primaryCellAt(ro
w, column - 1) == cell) | 33 if (column > dirtiedColumns.start() && m_layoutTableSection.primaryCellAt(ro
w, column - 1) == cell) |
| 34 return nullptr; | 34 return nullptr; |
| 35 return cell; | 35 return cell; |
| 36 } | 36 } |
| 37 | 37 |
| 38 void TableSectionPainter::paintRepeatingHeaderGroup(const PaintInfo& paintInfo,
const LayoutPoint& paintOffset, const CollapsedBorderValue& currentBorderValue,
ItemToPaint itemToPaint) | 38 void TableSectionPainter::paintRepeatingHeaderGroup(const PaintInfo& paintInfo,
const LayoutPoint& paintOffset, const CollapsedBorderValue& currentBorderValue,
ItemToPaint itemToPaint) |
| 39 { | 39 { |
| 40 if (!m_layoutTableSection.hasRepeatingHeaderGroup()) | 40 if (!m_layoutTableSection.isRepeatingHeaderGroup()) |
| 41 return; | 41 return; |
| 42 | 42 |
| 43 LayoutTable* table = m_layoutTableSection.table(); | 43 LayoutTable* table = m_layoutTableSection.table(); |
| 44 LayoutPoint paginationOffset = paintOffset; | 44 LayoutPoint paginationOffset = paintOffset; |
| 45 LayoutUnit pageHeight = table->pageLogicalHeightForOffset(LayoutUnit()); | 45 LayoutUnit pageHeight = table->pageLogicalHeightForOffset(LayoutUnit()); |
| 46 | 46 |
| 47 // Move paginationOffset to the top of the next page. | 47 // Move paginationOffset to the top of the next page. |
| 48 // The header may have a pagination strut before it so we need to account fo
r that when establishing its position. | 48 // The header may have a pagination strut before it so we need to account fo
r that when establishing its position. |
| 49 LayoutUnit headerGroupOffset = table->pageLogicalOffset(); | 49 LayoutUnit headerGroupOffset = table->pageLogicalOffset(); |
| 50 if (LayoutTableRow* row = m_layoutTableSection.firstRow()) | 50 if (LayoutTableRow* row = m_layoutTableSection.firstRow()) |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 DisplayItem::Type type = shadowStyle == Normal ? DisplayItem::kTableSectionB
oxShadowNormal : DisplayItem::kTableSectionBoxShadowInset; | 300 DisplayItem::Type type = shadowStyle == Normal ? DisplayItem::kTableSectionB
oxShadowNormal : DisplayItem::kTableSectionBoxShadowInset; |
| 301 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutTableSection, type)) | 301 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutTableSection, type)) |
| 302 return; | 302 return; |
| 303 | 303 |
| 304 LayoutRect bounds = BoxPainter(m_layoutTableSection).boundsForDrawingRecorde
r(paintInfo, paintOffset); | 304 LayoutRect bounds = BoxPainter(m_layoutTableSection).boundsForDrawingRecorde
r(paintInfo, paintOffset); |
| 305 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection
, type, bounds); | 305 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection
, type, bounds); |
| 306 BoxPainter::paintBoxShadow(paintInfo, LayoutRect(paintOffset, m_layoutTableS
ection.size()), m_layoutTableSection.styleRef(), shadowStyle); | 306 BoxPainter::paintBoxShadow(paintInfo, LayoutRect(paintOffset, m_layoutTableS
ection.size()), m_layoutTableSection.styleRef(), shadowStyle); |
| 307 } | 307 } |
| 308 | 308 |
| 309 } // namespace blink | 309 } // namespace blink |
| OLD | NEW |