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

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

Issue 2882043002: Update our treatment of repeating headers in tables (Closed)
Patch Set: bug 720620 Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableSection.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
index f1f68fd79263c9a999934a5b0a683a615307427e..bf7688327f5b8d58ad071fc95a9e3276fd1c9313 100644
--- a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
@@ -33,8 +33,10 @@ void TableSectionPainter::PaintRepeatingHeaderGroup(
LayoutUnit header_group_offset = table->BlockOffsetToFirstRepeatableHeader();
// The header may have a pagination strut before it so we need to account for
// that when establishing its position.
+ LayoutUnit strut_on_first_row;
if (LayoutTableRow* row = layout_table_section_.FirstRow())
- header_group_offset += row->PaginationStrut();
+ strut_on_first_row = row->PaginationStrut();
+ header_group_offset += strut_on_first_row;
LayoutUnit offset_to_next_page =
page_height - IntMod(header_group_offset, page_height);
// Move paginationOffset to the top of the next page.
@@ -59,11 +61,16 @@ void TableSectionPainter::PaintRepeatingHeaderGroup(
paint_offset.Y() + total_height_of_rows);
while (pagination_offset.Y() < bottom_bound) {
+ LayoutPoint nested_offset = pagination_offset;
+ LayoutUnit height_of_previous_headers =
+ table->RowOffsetFromRepeatingHeader() -
+ layout_table_section_.LogicalHeight() + strut_on_first_row;
+ nested_offset.Move(LayoutUnit(), height_of_previous_headers);
if (item_to_paint == kPaintCollapsedBorders) {
- PaintCollapsedSectionBorders(paint_info, pagination_offset,
+ PaintCollapsedSectionBorders(paint_info, nested_offset,
current_border_value);
} else {
- PaintSection(paint_info, pagination_offset);
+ PaintSection(paint_info, nested_offset);
}
pagination_offset.Move(0, page_height.ToInt());
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableSection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698