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 1cfb42f74330e7964fa9a1c9a29e743c93824800..b5d6e77d78ca74c0c9d70d95cc81ea764aebd727 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp |
@@ -981,6 +981,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; |
} |
@@ -1108,7 +1113,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) |