Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1131 line_box.SetPaginationStrut(LayoutUnit()); | 1131 line_box.SetPaginationStrut(LayoutUnit()); |
| 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 LayoutUnit remaining_logical_height_including_footer = | |
| 1142 remaining_logical_height - layout_state->HeightOffsetForTableFooters(); | |
|
mstensho (USE GERRIT)
2017/06/16 08:43:05
Isn't this something that belongs inside PageRemai
rhogan
2017/06/20 18:46:05
I've explained why I think this is the way to do i
| |
| 1141 int line_index = LineCount(&line_box); | 1143 int line_index = LineCount(&line_box); |
| 1142 if (remaining_logical_height < line_height || | 1144 if (remaining_logical_height_including_footer < line_height || |
| 1143 (ShouldBreakAtLineToAvoidWidow() && | 1145 (ShouldBreakAtLineToAvoidWidow() && |
| 1144 LineBreakToAvoidWidow() == line_index)) { | 1146 LineBreakToAvoidWidow() == line_index)) { |
| 1145 LayoutUnit pagination_strut = CalculatePaginationStrutToFitContent( | 1147 LayoutUnit pagination_strut = CalculatePaginationStrutToFitContent( |
| 1146 logical_offset, remaining_logical_height, line_height); | 1148 logical_offset, remaining_logical_height, line_height); |
| 1147 LayoutUnit new_logical_offset = logical_offset + pagination_strut; | 1149 LayoutUnit new_logical_offset = logical_offset + pagination_strut; |
| 1148 // Moving to a different page or column may mean that its height is | 1150 // Moving to a different page or column may mean that its height is |
| 1149 // different. | 1151 // different. |
| 1150 page_logical_height = PageLogicalHeightForOffset(new_logical_offset); | 1152 page_logical_height = PageLogicalHeightForOffset(new_logical_offset); |
| 1151 if (line_height > page_logical_height) { | 1153 if (line_height > page_logical_height) { |
| 1152 // Too tall to fit in one page / column. Give up. Don't push to the next | 1154 // Too tall to fit in one page / column. Give up. Don't push to the next |
| (...skipping 3610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4763 return LayoutBlock::DeprecatedInvalidatePaint(paint_invalidation_state); | 4765 return LayoutBlock::DeprecatedInvalidatePaint(paint_invalidation_state); |
| 4764 } | 4766 } |
| 4765 | 4767 |
| 4766 void LayoutBlockFlow::InvalidateDisplayItemClients( | 4768 void LayoutBlockFlow::InvalidateDisplayItemClients( |
| 4767 PaintInvalidationReason invalidation_reason) const { | 4769 PaintInvalidationReason invalidation_reason) const { |
| 4768 BlockFlowPaintInvalidator(*this).InvalidateDisplayItemClients( | 4770 BlockFlowPaintInvalidator(*this).InvalidateDisplayItemClients( |
| 4769 invalidation_reason); | 4771 invalidation_reason); |
| 4770 } | 4772 } |
| 4771 | 4773 |
| 4772 } // namespace blink | 4774 } // namespace blink |
| OLD | NEW |