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

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

Issue 2584143003: Repeat footers in paginated context (Closed)
Patch Set: bug 656232 Created 3 years, 4 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/css/html.css ('k') | third_party/WebKit/Source/core/layout/LayoutState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 5f7b6479ef33e3a0769ab0be720dead38a7d2dbd..78702e3d8538196b47ad7186b637506fb5adf4ef 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -5835,10 +5835,13 @@ LayoutUnit LayoutBox::PageRemainingLogicalHeightForOffset(
LayoutView* layout_view = View();
offset += OffsetFromLogicalTopOfFirstPage();
+ LayoutUnit footer_height =
+ View()->GetLayoutState()->HeightOffsetForTableFooters();
LayoutFlowThread* flow_thread = FlowThreadContainingBlock();
+ LayoutUnit remaining_height;
if (!flow_thread) {
LayoutUnit page_logical_height = layout_view->PageLogicalHeight();
- LayoutUnit remaining_height =
+ remaining_height =
page_logical_height - IntMod(offset, page_logical_height);
if (page_boundary_rule == kAssociateWithFormerPage) {
// An offset exactly at a page boundary will act as being part of the
@@ -5846,11 +5849,11 @@ LayoutUnit LayoutBox::PageRemainingLogicalHeightForOffset(
// part of the latter (i.e. one whole page length of remaining space).
remaining_height = IntMod(remaining_height, page_logical_height);
}
- return remaining_height;
+ } else {
+ remaining_height = flow_thread->PageRemainingLogicalHeightForOffset(
+ offset, page_boundary_rule);
}
-
- return flow_thread->PageRemainingLogicalHeightForOffset(offset,
- page_boundary_rule);
+ return remaining_height - footer_height;
}
bool LayoutBox::CrossesPageBoundary(LayoutUnit offset,
@@ -5867,11 +5870,12 @@ LayoutUnit LayoutBox::CalculatePaginationStrutToFitContent(
LayoutUnit strut_to_next_page =
PageRemainingLogicalHeightForOffset(offset, kAssociateWithLatterPage);
+ LayoutState* layout_state = View()->GetLayoutState();
+ strut_to_next_page += layout_state->HeightOffsetForTableFooters();
// If we're inside a cell in a row that straddles a page then avoid the
// repeating header group if necessary. If we're a table section we're
// already accounting for it.
if (!IsTableSection()) {
- LayoutState* layout_state = View()->GetLayoutState();
strut_to_next_page += layout_state->HeightOffsetForTableHeaders();
}
« no previous file with comments | « third_party/WebKit/Source/core/css/html.css ('k') | third_party/WebKit/Source/core/layout/LayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698