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

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

Issue 2587673003: Content of cell should avoid repeating headers when it straddles multiple pages (Closed)
Patch Set: bug 675453 Created 4 years 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/LayoutTableRow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
index c814ba3d77ccdd886e527868f947fb241e5b862f..7a3d52dff0f42f181a4976ee78181bc3e1d1259c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
@@ -312,4 +312,16 @@ void LayoutTableRow::addOverflowFromCell(const LayoutTableCell* cell) {
addContentsVisualOverflow(cellVisualOverflowRect);
}
+bool LayoutTableRow::isFirstRowInSectionAfterHeader() const {
+ // If there isn't room for at least one content row on a page after the
+ // header group, then we won't repeat the header on each page.
+ // https://drafts.csswg.org/css-tables-3/#repeated-headers reads like
+ // it wants us to drop headers on only the pages that a single row
+ // won't fit but we avoid the complexity of that reading until it
+ // is clarified. Tracked by crbug.com/675904
+ LayoutTableSection* header = table()->header();
mstensho (USE GERRIT) 2016/12/20 11:47:00 Might want to do an early return for rowIndex() i
rhogan 2016/12/20 16:06:37 return !rowIndex() && ..; returns just as quickly
mstensho (USE GERRIT) 2016/12/20 16:50:36 I was thinking that you could put it in front of t
mstensho (USE GERRIT) 2016/12/20 18:20:54 Did you mean to address this too?
+ return !rowIndex() && header && table()->sectionAbove(section()) == header &&
+ header->getPaginationBreakability() != AllowAnyBreaks;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698