| 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)
|
|
|