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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTable.cpp

Issue 2219153002: Offset repeating theads correctly when two tables adjoin at a page border (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bug 634404 Created 4 years, 4 months 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
Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index 38961ef6b09c737491c0767b5d21aab5a27c0e4a..d078fac195f91da727abdfcdf15ce4eaeb03a299 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -543,9 +543,15 @@ void LayoutTable::layout()
section->setLogicalTop(logicalOffset);
section->layoutRows();
logicalOffset += section->logicalHeight();
- if (isPaginated && m_head && m_head == section && section->logicalHeight() < section->pageLogicalHeightForOffset(logicalOffset)) {
+ // If the section is a repeating header group that allows at least one row of content then store the
+ // offset for other sections to offset their rows against.
+ if (isPaginated && m_head && m_head == section && section->logicalHeight() < section->pageLogicalHeightForOffset(logicalOffset)
+ && section->getPaginationBreakability() != LayoutBox::AllowAnyBreaks) {
LayoutUnit offsetForTableHeaders = state.heightOffsetForTableHeaders();
+ // Don't include any strut in the header group - we only want the height from its content.
offsetForTableHeaders += section->logicalHeight();
+ if (LayoutTableRow* row = section->firstRow())
+ offsetForTableHeaders -= section->paginationStrutForRow(row, section->logicalTop());
state.setHeightOffsetForTableHeaders(offsetForTableHeaders);
}
}

Powered by Google App Engine
This is Rietveld 408576698