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

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

Issue 2021703002: Display table header groups at the top of each page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 4 years, 7 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/LayoutTableSection.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
index 7ed46e8678ee4fb93309222f4e8ffb0423031181..f1808351efcc619b984ebfe727f37585231b76e7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -972,6 +972,11 @@ void LayoutTableSection::layoutRows()
if (isPaginated) {
paginationStrutOnRow = paginationStrutForRow(rowLayoutObject, LayoutUnit(m_rowPos[r]));
if (paginationStrutOnRow) {
+ LayoutTableSection* header = table()->header();
+ // If we have a header group we will paint it at the top of each page, move the rows
+ // down to accomodate it.
+ if (header && header != this)
+ paginationStrutOnRow += header->logicalHeight().toInt();
for (unsigned rowIndex = r; rowIndex <= totalRows; rowIndex++)
m_rowPos[rowIndex] += paginationStrutOnRow;
}
@@ -1099,7 +1104,10 @@ void LayoutTableSection::layoutRows()
int LayoutTableSection::paginationStrutForRow(LayoutTableRow* row, LayoutUnit logicalOffset) const
{
- if (row->getPaginationBreakability() == AllowAnyBreaks)
+ // Even if the row allows us to break-inside, we will want to put a strut on the row if we have a header
+ // group that wants to appear at the top of each page.
+ bool tableHeaderForcesStrut = table()->header() ? table()->header()->getPaginationBreakability() != AllowAnyBreaks : false;
+ if (row->getPaginationBreakability() == AllowAnyBreaks && !tableHeaderForcesStrut)
return 0;
LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
if (!pageLogicalHeight)

Powered by Google App Engine
This is Rietveld 408576698