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

Unified Diff: third_party/WebKit/Source/core/paint/CollapsedBorderPainter.cpp

Issue 2584143003: Repeat footers in paginated context (Closed)
Patch Set: bug 656232 Created 3 years, 5 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/paint/CollapsedBorderPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/CollapsedBorderPainter.cpp b/third_party/WebKit/Source/core/paint/CollapsedBorderPainter.cpp
index 86cbedac467d3876e45a4e55a82a2083a7c78ad3..d95dd4b3556576630cdbf15c424772bfd28fba5d 100644
--- a/third_party/WebKit/Source/core/paint/CollapsedBorderPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/CollapsedBorderPainter.cpp
@@ -86,14 +86,20 @@ void CollapsedBorderPainter::SetupBorders() {
// Skip painting the before border if it will be painted by the above cell
// as its after border. If we break page before the row with non-zero strut
- // (which means a gap between this row and the row above), we need to paint
- // the before border separately.
+ // (which means a gap between this row and the row above), or if we are
+ // painting the top row of a footer that repeats on each page we need to paint
+ // the before border separately. This will double-paint the top border of the
+ // footer on the last page.
if (before_.value && !cell_.Row()->PaginationStrut()) {
const auto* cell_above = table_.CellAbove(cell_);
if (cell_.StartsAtSameColumn(cell_above) &&
cell_above->ColSpan() >= cell_.ColSpan() &&
cell_above->Row()->HasSameDirectionAs(&table_)) {
- before_.value = nullptr;
+ bool cell_is_top_of_repeating_footer =
+ cell_.Section()->IsRepeatingFooterGroup() &&
+ (!cell_above || cell_above->Section() != cell_.Section());
+ if (!cell_is_top_of_repeating_footer)
+ before_.value = nullptr;
// Otherwise we'll still paint the shared border twice which may cause
// incorrect border conflict resolution for row/col spanning cells.
// TODO(crbug.com/2902 etc.): Paint collapsed borders by grid cells.

Powered by Google App Engine
This is Rietveld 408576698