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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.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
« 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/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index 1c653aff8018b9e432844329a840fa11fc901833..1edb17a3d5bc4c4a3abdcad3f8e69ca04f036ac7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -1149,7 +1149,11 @@ void LayoutBlockFlow::AdjustLinePositionForPagination(RootInlineBox& line_box,
LayoutUnit remaining_logical_height = PageRemainingLogicalHeightForOffset(
logical_offset, kAssociateWithLatterPage);
int line_index = LineCount(&line_box);
- if (remaining_logical_height < line_height ||
+ // We need to detect if we overlap a repeating footer and if so take the
+ // full remaining logical height as our strut to the next page.
+ LayoutUnit remaining_logical_height_including_footer =
+ remaining_logical_height - layout_state->HeightOffsetForTableFooters();
+ if (remaining_logical_height_including_footer < line_height ||
(ShouldBreakAtLineToAvoidWidow() &&
LineBreakToAvoidWidow() == line_index)) {
LayoutUnit pagination_strut = CalculatePaginationStrutToFitContent(
@@ -1256,7 +1260,10 @@ LayoutUnit LayoutBlockFlow::AdjustForUnsplittableChild(
return logical_offset;
LayoutUnit remaining_logical_height = PageRemainingLogicalHeightForOffset(
logical_offset, kAssociateWithLatterPage);
- if (remaining_logical_height >= child_logical_height)
+ LayoutUnit remaining_logical_height_including_footer =
+ remaining_logical_height -
+ View()->GetLayoutState()->HeightOffsetForTableFooters();
+ if (remaining_logical_height_including_footer >= child_logical_height)
return logical_offset; // It fits fine where it is. No need to break.
LayoutUnit pagination_strut = CalculatePaginationStrutToFitContent(
logical_offset, remaining_logical_height, child_logical_height);
« 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