Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: third_party/WebKit/Source/core/paint/TableSectionPainter.cpp

Issue 2466253004: Don't paint repeating header if only the border spacing exceeds page height (Closed)
Patch Set: bug 642814 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 +
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698