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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTable.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
Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index 0ec92466726ca365107bb7438b780574abe9f0ac..d407c917a46d3470b025916f2765f31e08f6c7c2 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -470,8 +470,10 @@ void LayoutTable::LayoutSection(
bool needed_layout = section.NeedsLayout();
if (needed_layout)
section.UpdateLayout();
- if (needed_layout || table_height_changing == kTableHeightChanging)
+ if (needed_layout || table_height_changing == kTableHeightChanging) {
section.SetLogicalHeight(LayoutUnit(section.CalcRowLogicalHeight()));
+ section.DetermineIfHeaderGroupShouldRepeat();
+ }
if (View()->GetLayoutState()->IsPaginated())
UpdateFragmentationInfoForChild(section);
@@ -661,15 +663,15 @@ void LayoutTable::UpdateLayout() {
// If the repeating header group allows at least one row of content,
// then store the offset for other sections to offset their rows
// against.
- LayoutUnit section_logical_height = section->LogicalHeight();
- if (section_logical_height <
- section->PageLogicalHeightForOffset(section->LogicalTop()) &&
- section->GetPaginationBreakability() != kAllowAnyBreaks) {
+ if (section->IsRepeatingHeaderGroup()) {
+ LayoutUnit offset_for_table_headers =
+ state.HeightOffsetForTableHeaders();
+ offset_for_table_headers += section->LogicalHeight();
// Don't include any strut in the header group - we only want the
// height from its content.
- LayoutUnit offset_for_table_headers = section_logical_height;
if (LayoutTableRow* row = section->FirstRow())
offset_for_table_headers -= row->PaginationStrut();
+ state.SetHeightOffsetForTableHeaders(offset_for_table_headers);
SetRowOffsetFromRepeatingHeader(offset_for_table_headers);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutState.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableRow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698