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

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

Issue 2326303002: Don't repeat headers if at least one row of content doesn't fit (Closed)
Patch Set: bug 624814 Created 4 years, 3 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 67ffa078bd29636e2bddbc08d819cbcd9e414710..76a383da06047612c9b1fb42a3f7bddd58bd85fc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -1002,10 +1002,11 @@ void LayoutTableSection::layoutRows()
rowLayoutObject->updateLayerTransformAfterLayout();
if (isPaginated) {
paginationStrutOnRow = paginationStrutForRow(rowLayoutObject, LayoutUnit(m_rowPos[r]));
mstensho (USE GERRIT) 2016/09/15 06:31:55 I think this should be the one and only call to pa
+ rowLayoutObject->setPaginationStrut(LayoutUnit(paginationStrutOnRow));
if (paginationStrutOnRow) {
// 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() && table()->sectionAbove(this) == table()->header())
+ if (!r && table()->header() && table()->sectionAbove(this) == table()->header() && table()->header()->getPaginationBreakability() != AllowAnyBreaks)
state.setHeightOffsetForTableHeaders(state.heightOffsetForTableHeaders() - table()->header()->logicalHeight());
// If we have a header group we will paint it at the top of each page, move the rows
// down to accomodate it.
@@ -1718,7 +1719,7 @@ void LayoutTableSection::setLogicalPositionForCell(LayoutTableCell* cell, unsign
cell->setLogicalLocation(cellLocation);
}
-bool LayoutTableSection::hasRepeatingHeaderGroup() const
+bool LayoutTableSection::isRepeatingHeaderGroup() const
{
if (getPaginationBreakability() == LayoutBox::AllowAnyBreaks)
return false;
@@ -1735,7 +1736,7 @@ bool LayoutTableSection::hasRepeatingHeaderGroup() const
// If the first row of the section after the header group doesn't fit on the page, then
// don't repeat the header on each page. See https://drafts.csswg.org/css-tables-3/#repeated-headers
LayoutTableSection* sectionBelow = table()->sectionBelow(this);
- if (sectionBelow && sectionBelow->firstRow() && sectionBelow->paginationStrutForRow(sectionBelow->firstRow(), sectionBelow->logicalTop()))
+ if (sectionBelow && sectionBelow->firstRow() && sectionBelow->firstRow()->paginationStrut())
return false;
return true;
@@ -1748,7 +1749,7 @@ bool LayoutTableSection::mapToVisualRectInAncestorSpace(const LayoutBoxModelObje
// Repeating table headers are painted once per fragmentation page/column. This does not go through the regular fragmentation machinery,
// so we need special code to expand the invalidation rect to contain all positions of the header in all columns.
// Note that this is in flow thread coordinates, not visual coordinates. The enclosing LayoutFlowThread will convert to visual coordinates.
- if (table()->header() == this && hasRepeatingHeaderGroup())
+ if (table()->header() == this && isRepeatingHeaderGroup())
rect.setHeight(table()->logicalHeight());
return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect, flags);
}

Powered by Google App Engine
This is Rietveld 408576698