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

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

Issue 2366193002: Fix paint invalidation rects for repeating paginated table headers. (Closed)
Patch Set: 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 407c56fca2ded2dd62a4a5a4a208d9a46a630fea..0ae4fb46923ad596b573577cd6a435dc06ebf617 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -1690,4 +1690,30 @@ void LayoutTableSection::setLogicalPositionForCell(LayoutTableCell* cell, unsign
cell->setLogicalLocation(cellLocation);
}
+bool LayoutTableSection::hasRepeatingHeaderGroup() const
+{
+ if (getPaginationBreakability() == LayoutBox::AllowAnyBreaks)
+ return false;
+ // TODO(rhogan): Should we paint a header repeatedly if it's self-painting?
+ if (hasSelfPaintingLayer())
+ return false;
+ LayoutUnit pageHeight = table()->pageLogicalHeightForOffset(LayoutUnit());
+ if (!pageHeight)
+ return false;
+ return true;
+}
+
+bool LayoutTableSection::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, VisualRectFlags flags) const
+{
+ if (ancestor == this)
+ return true;
+ // 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())
+ rect.setHeight(table()->logicalHeight());
+ return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect, flags);
+}
+
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698