Chromium Code Reviews| 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 36cdfe6537f2b5c110527b888b857cebd0ddd057..921677a2bfb13dd3c1729fe8f5a7743fbe8ea53d 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp |
| @@ -1130,7 +1130,8 @@ void LayoutBlockFlow::AdjustLinePositionForPagination(RootInlineBox& line_box, |
| logical_offset += delta; |
| line_box.SetPaginationStrut(LayoutUnit()); |
| line_box.SetIsFirstAfterPageBreak(false); |
| - if (!View()->GetLayoutState()->IsPaginated()) |
| + LayoutState* layout_state = View()->GetLayoutState(); |
| + if (!layout_state->IsPaginated()) |
| return; |
| LayoutUnit page_logical_height = PageLogicalHeightForOffset(logical_offset); |
| if (!page_logical_height) |
| @@ -1194,14 +1195,23 @@ void LayoutBlockFlow::AdjustLinePositionForPagination(RootInlineBox& line_box, |
| // up in the next column or page. Setting a strut on the block is also |
| // important when it comes to satisfying orphan requirements. |
| if (ShouldSetStrutOnBlock(*this, line_box, logical_offset, line_index, |
| - page_logical_height)) |
| - strut_to_propagate = logical_offset; |
| + page_logical_height)) { |
| + DCHECK(!IsTableCell()); |
| + strut_to_propagate = |
| + logical_offset + layout_state->HeightOffsetForTableHeaders(); |
| + } else { |
| + LayoutUnit pagination_strut = layout_state->HeightOffsetForTableHeaders(); |
| + delta += pagination_strut; |
| + line_box.SetPaginationStrut(pagination_strut); |
| + line_box.SetIsFirstAfterPageBreak(true); |
|
mstensho (USE GERRIT)
2017/05/30 19:43:55
Already taken care of above (line 1192).
|
| + } |
| } else if (line_box == FirstRootBox() && AllowsPaginationStrut()) { |
| // This is the first line in the block. The block may still start in the |
| // previous column or page, and if that's the case, attempt to pull it over |
| // to where this line is, so that we don't split the top border or padding. |
| - LayoutUnit strut = |
| - remaining_logical_height + logical_offset - page_logical_height; |
| + LayoutUnit strut = remaining_logical_height + logical_offset + |
| + layout_state->HeightOffsetForTableHeaders() - |
| + page_logical_height; |
| if (strut > LayoutUnit()) { |
| // The block starts in a previous column or page. Set a strut on the block |
| // if there's room for the top border, padding and the line in one column |