Chromium Code Reviews| 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 94d4263d1d2d338a29a17a9e2ea44cd9f0a5dbd5..f684a8a75846f0f772b740e803235ca78467c59e 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp |
| @@ -1102,7 +1102,13 @@ void LayoutTableSection::layoutRows() { |
| paginationStrutOnRow = |
| paginationStrutForRow(rowLayoutObject, LayoutUnit(m_rowPos[r])); |
| rowLayoutObject->setPaginationStrut(LayoutUnit(paginationStrutOnRow)); |
| - if (paginationStrutOnRow) { |
| + bool rowIsAtTopOfColumn = |
| + pageRemainingLogicalHeightForOffset( |
| + LayoutUnit(m_rowPos[r]), |
| + LayoutBlock::AssociateWithLatterPage) == |
|
mstensho (USE GERRIT)
2016/10/05 18:21:11
LayoutBlock:: prefix not necessary.
|
| + pageLogicalHeightForOffset(LayoutUnit(m_rowPos[r])); |
| + if (paginationStrutOnRow || |
| + (state.heightOffsetForTableHeaders() && rowIsAtTopOfColumn)) { |
| // If there isn't room for at least one content row on a page with a header group, then |
| // we won't repeat the header on each page. |
| if (!r && table()->header() && |
| @@ -1267,8 +1273,17 @@ int LayoutTableSection::paginationStrutForRow(LayoutTableRow* row, |
| LayoutUnit rowLogicalHeight = row->logicalHeight(); |
| if (rowLogicalHeight > pageLogicalHeight) |
| return 0; |
| + |
| LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset( |
| logicalOffset, LayoutBlock::AssociateWithLatterPage); |
| + LayoutUnit offsetForBorderSpacing = |
| + pageLogicalHeight - (remainingLogicalHeight + table()->vBorderSpacing()); |
| + // Border spacing from the previous row has pushed this row just past the top |
| + // of the page, so we must reposition it to the top of the page and avoid any |
| + // repeating header. |
| + if (offsetForBorderSpacing < 0) |
| + return offsetForBorderSpacing.toInt(); |
| + |
| if (remainingLogicalHeight >= rowLogicalHeight) |
| return 0; // It fits fine where it is. No need to break. |
| LayoutUnit paginationStrut = calculatePaginationStrutToFitContent( |