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

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..b890f002648075ffad205773aa75642df8de8f0f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -543,9 +543,13 @@ 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();
- offsetForTableHeaders += section->logicalHeight();
+ // Don't include any strut in the header group - we only want the height from its content.
+ offsetForTableHeaders += section->logicalHeight() - section->paginationStrutForRow(section->firstRow(), section->logicalTop());
mstensho (USE GERRIT) 2016/08/10 09:42:48 section->firstRow() may be nullptr.
state.setHeightOffsetForTableHeaders(offsetForTableHeaders);
}
}

Powered by Google App Engine
This is Rietveld 408576698