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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 2584143003: Repeat footers in paginated context (Closed)
Patch Set: bug 656232 Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 line_box.SetIsFirstAfterPageBreak(false); 1132 line_box.SetIsFirstAfterPageBreak(false);
1133 LayoutState* layout_state = View()->GetLayoutState(); 1133 LayoutState* layout_state = View()->GetLayoutState();
1134 if (!layout_state->IsPaginated()) 1134 if (!layout_state->IsPaginated())
1135 return; 1135 return;
1136 if (!IsPageLogicalHeightKnown()) 1136 if (!IsPageLogicalHeightKnown())
1137 return; 1137 return;
1138 LayoutUnit page_logical_height = PageLogicalHeightForOffset(logical_offset); 1138 LayoutUnit page_logical_height = PageLogicalHeightForOffset(logical_offset);
1139 LayoutUnit remaining_logical_height = PageRemainingLogicalHeightForOffset( 1139 LayoutUnit remaining_logical_height = PageRemainingLogicalHeightForOffset(
1140 logical_offset, kAssociateWithLatterPage); 1140 logical_offset, kAssociateWithLatterPage);
1141 int line_index = LineCount(&line_box); 1141 int line_index = LineCount(&line_box);
1142 if (remaining_logical_height < line_height || 1142 // We need to detect if we overlap a repeating footer and if so take the
1143 // full remaining logical height as our strut to the next page.
mstensho (USE GERRIT) 2017/06/20 21:39:05 But why wouldn't you want to do the same for other
1144 LayoutUnit remaining_logical_height_including_footer =
1145 remaining_logical_height - layout_state->HeightOffsetForTableFooters();
1146 if (remaining_logical_height_including_footer < line_height ||
1143 (ShouldBreakAtLineToAvoidWidow() && 1147 (ShouldBreakAtLineToAvoidWidow() &&
1144 LineBreakToAvoidWidow() == line_index)) { 1148 LineBreakToAvoidWidow() == line_index)) {
1145 LayoutUnit pagination_strut = CalculatePaginationStrutToFitContent( 1149 LayoutUnit pagination_strut = CalculatePaginationStrutToFitContent(
1146 logical_offset, remaining_logical_height, line_height); 1150 logical_offset, remaining_logical_height, line_height);
1147 LayoutUnit new_logical_offset = logical_offset + pagination_strut; 1151 LayoutUnit new_logical_offset = logical_offset + pagination_strut;
1148 // Moving to a different page or column may mean that its height is 1152 // Moving to a different page or column may mean that its height is
1149 // different. 1153 // different.
1150 page_logical_height = PageLogicalHeightForOffset(new_logical_offset); 1154 page_logical_height = PageLogicalHeightForOffset(new_logical_offset);
1151 if (line_height > page_logical_height) { 1155 if (line_height > page_logical_height) {
1152 // Too tall to fit in one page / column. Give up. Don't push to the next 1156 // Too tall to fit in one page / column. Give up. Don't push to the next
(...skipping 3606 matching lines...) Expand 10 before | Expand all | Expand 10 after
4759 return LayoutBlock::DeprecatedInvalidatePaint(paint_invalidation_state); 4763 return LayoutBlock::DeprecatedInvalidatePaint(paint_invalidation_state);
4760 } 4764 }
4761 4765
4762 void LayoutBlockFlow::InvalidateDisplayItemClients( 4766 void LayoutBlockFlow::InvalidateDisplayItemClients(
4763 PaintInvalidationReason invalidation_reason) const { 4767 PaintInvalidationReason invalidation_reason) const {
4764 BlockFlowPaintInvalidator(*this).InvalidateDisplayItemClients( 4768 BlockFlowPaintInvalidator(*this).InvalidateDisplayItemClients(
4765 invalidation_reason); 4769 invalidation_reason);
4766 } 4770 }
4767 4771
4768 } // namespace blink 4772 } // namespace blink
OLDNEW
« 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