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

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

Issue 2388613002: Move below headers even when row doesn't require a strut (Closed)
Patch Set: bug 642814 Created 4 years, 2 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 94d4263d1d2d338a29a17a9e2ea44cd9f0a5dbd5..d9469e4bef905d92aab91512919affe7063c14d6 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -1102,7 +1102,8 @@ void LayoutTableSection::layoutRows() {
paginationStrutOnRow =
paginationStrutForRow(rowLayoutObject, LayoutUnit(m_rowPos[r]));
rowLayoutObject->setPaginationStrut(LayoutUnit(paginationStrutOnRow));
- if (paginationStrutOnRow) {
+ if (paginationStrutOnRow ||
+ needsStrutForTableHeaders(state, LayoutUnit(m_rowPos[r]))) {
// 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 +1268,16 @@ 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
mstensho (USE GERRIT) 2016/10/04 21:02:38 Should wrap this comment at 80 cols.
+ // 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(

Powered by Google App Engine
This is Rietveld 408576698