Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/TableSectionPainter.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp |
| index 829be97b402c4b56cad3cda5d6dddcfdaff03802..43b659edd0e586dfe5b767ca506fc200e963a8c4 100644 |
| --- a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp |
| @@ -52,14 +52,14 @@ void TableSectionPainter::paintRepeatingHeaderGroup( |
| LayoutPoint paginationOffset = paintOffset; |
| LayoutUnit pageHeight = table->pageLogicalHeightForOffset(LayoutUnit()); |
| - // Move paginationOffset to the top of the next page. |
| + LayoutUnit headerGroupOffset = table->blockOffsetToFirstRepeatableHeader(); |
| // The header may have a pagination strut before it so we need to account for |
| // that when establishing its position. |
| - LayoutUnit headerGroupOffset = table->blockOffsetToFirstRepeatableHeader(); |
| if (LayoutTableRow* row = m_layoutTableSection.firstRow()) |
| headerGroupOffset += row->paginationStrut(); |
| LayoutUnit offsetToNextPage = |
| pageHeight - intMod(headerGroupOffset, pageHeight); |
| + // Move paginationOffset to the top of the next page. |
| paginationOffset.move(LayoutUnit(), offsetToNextPage); |
| // Now move paginationOffset to the top of the page the cull rect starts on. |
| if (paintInfo.cullRect().m_rect.y() > paginationOffset.y()) { |
| @@ -69,10 +69,17 @@ void TableSectionPainter::paintRepeatingHeaderGroup( |
| pageHeight) |
| .toInt()); |
| } |
| + |
| + // We only want to consider pages where we going to paint a row, so exclude |
| + // captions and border spacing from the table. |
| + LayoutRect sectionsRect(LayoutPoint(), table->size()); |
| + table->subtractCaptionRect(sectionsRect); |
| + LayoutUnit totalHeightOfRows = |
| + sectionsRect.height() - table->vBorderSpacing(); |
|
mstensho (USE GERRIT)
2016/11/02 20:14:26
This is wrong in vertical writing modes, but I gue
|
| LayoutUnit bottomBound = |
| std::min(LayoutUnit(paintInfo.cullRect().m_rect.maxY()), |
| - paintOffset.y() + table->logicalHeight()); |
| - paginationOffset.move(LayoutUnit(), -m_layoutTableSection.logicalTop()); |
| + paintOffset.y() + totalHeightOfRows); |
| + |
| while (paginationOffset.y() < bottomBound) { |
| LayoutPoint nestedOffset = |
| paginationOffset + |