Chromium Code Reviews| 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/LayoutTableCaption.h" | |
| 7 #include "core/layout/LayoutTableCell.h" | 8 #include "core/layout/LayoutTableCell.h" |
| 8 #include "core/layout/LayoutTableCol.h" | 9 #include "core/layout/LayoutTableCol.h" |
| 9 #include "core/layout/LayoutTableRow.h" | 10 #include "core/layout/LayoutTableRow.h" |
| 10 #include "core/paint/BoxClipper.h" | 11 #include "core/paint/BoxClipper.h" |
| 11 #include "core/paint/BoxPainter.h" | 12 #include "core/paint/BoxPainter.h" |
| 12 #include "core/paint/LayoutObjectDrawingRecorder.h" | 13 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 13 #include "core/paint/ObjectPainter.h" | 14 #include "core/paint/ObjectPainter.h" |
| 14 #include "core/paint/PaintInfo.h" | 15 #include "core/paint/PaintInfo.h" |
| 15 #include "core/paint/TableCellPainter.h" | 16 #include "core/paint/TableCellPainter.h" |
| 16 #include "core/paint/TableRowPainter.h" | 17 #include "core/paint/TableRowPainter.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 // Now move paginationOffset to the top of the page the cull rect starts on. | 65 // Now move paginationOffset to the top of the page the cull rect starts on. |
| 65 if (paintInfo.cullRect().m_rect.y() > paginationOffset.y()) | 66 if (paintInfo.cullRect().m_rect.y() > paginationOffset.y()) |
| 66 paginationOffset.move( | 67 paginationOffset.move( |
| 67 0, pageHeight.toInt() * | 68 0, pageHeight.toInt() * |
| 68 ((paintInfo.cullRect().m_rect.y() - paginationOffset.y()) / | 69 ((paintInfo.cullRect().m_rect.y() - paginationOffset.y()) / |
| 69 pageHeight) | 70 pageHeight) |
| 70 .toInt()); | 71 .toInt()); |
| 71 LayoutUnit bottomBound = | 72 LayoutUnit bottomBound = |
| 72 std::min(LayoutUnit(paintInfo.cullRect().m_rect.maxY()), | 73 std::min(LayoutUnit(paintInfo.cullRect().m_rect.maxY()), |
| 73 paintOffset.y() + table->logicalHeight()); | 74 paintOffset.y() + table->logicalHeight()); |
| 75 if (table->topCaption()) | |
| 76 paginationOffset.move(0, -table->topCaption()->logicalHeight().toInt()); | |
|
mstensho (USE GERRIT)
2016/10/17 19:21:13
So, it's possible to have as many top captions as
rhogan
2016/10/18 16:02:46
Indeed, thanks - updated!
| |
| 74 while (paginationOffset.y() < bottomBound) { | 77 while (paginationOffset.y() < bottomBound) { |
| 75 LayoutPoint nestedOffset = | 78 LayoutPoint nestedOffset = |
| 76 paginationOffset + | 79 paginationOffset + |
| 77 LayoutPoint(0, m_layoutTableSection.offsetForRepeatingHeader().toInt()); | 80 LayoutPoint(0, m_layoutTableSection.offsetForRepeatingHeader().toInt()); |
| 78 if (itemToPaint == PaintCollapsedBorders) | 81 if (itemToPaint == PaintCollapsedBorders) |
| 79 paintCollapsedSectionBorders(paintInfo, nestedOffset, currentBorderValue); | 82 paintCollapsedSectionBorders(paintInfo, nestedOffset, currentBorderValue); |
| 80 else | 83 else |
| 81 paintSection(paintInfo, nestedOffset); | 84 paintSection(paintInfo, nestedOffset); |
| 82 paginationOffset.move(0, pageHeight.toInt()); | 85 paginationOffset.move(0, pageHeight.toInt()); |
| 83 } | 86 } |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 LayoutRect bounds = BoxPainter(m_layoutTableSection) | 393 LayoutRect bounds = BoxPainter(m_layoutTableSection) |
| 391 .boundsForDrawingRecorder(paintInfo, paintOffset); | 394 .boundsForDrawingRecorder(paintInfo, paintOffset); |
| 392 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection, | 395 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutTableSection, |
| 393 type, bounds); | 396 type, bounds); |
| 394 BoxPainter::paintBoxShadow( | 397 BoxPainter::paintBoxShadow( |
| 395 paintInfo, LayoutRect(paintOffset, m_layoutTableSection.size()), | 398 paintInfo, LayoutRect(paintOffset, m_layoutTableSection.size()), |
| 396 m_layoutTableSection.styleRef(), shadowStyle); | 399 m_layoutTableSection.styleRef(), shadowStyle); |
| 397 } | 400 } |
| 398 | 401 |
| 399 } // namespace blink | 402 } // namespace blink |
| OLD | NEW |