OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 5785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5796 return PageRemainingLogicalHeightForOffset(offset, kAssociateWithLatterPage) < | 5796 return PageRemainingLogicalHeightForOffset(offset, kAssociateWithLatterPage) < |
5797 logical_height; | 5797 logical_height; |
5798 } | 5798 } |
5799 | 5799 |
5800 LayoutUnit LayoutBox::CalculatePaginationStrutToFitContent( | 5800 LayoutUnit LayoutBox::CalculatePaginationStrutToFitContent( |
5801 LayoutUnit offset, | 5801 LayoutUnit offset, |
5802 LayoutUnit strut_to_next_page, | 5802 LayoutUnit strut_to_next_page, |
5803 LayoutUnit content_logical_height) const { | 5803 LayoutUnit content_logical_height) const { |
5804 DCHECK_EQ(strut_to_next_page, PageRemainingLogicalHeightForOffset( | 5804 DCHECK_EQ(strut_to_next_page, PageRemainingLogicalHeightForOffset( |
5805 offset, kAssociateWithLatterPage)); | 5805 offset, kAssociateWithLatterPage)); |
5806 // If we're a cell in a row that straddles a page then avoid the repeating | 5806 // If we're inside a cell in a row that straddles a page then avoid the |
5807 // header group if necessary. | 5807 // repeating header group if necessary. If we're a table section we're |
5808 if (IsTableCell()) { | 5808 // already accounting for it. |
5809 const LayoutTableCell* cell = ToLayoutTableCell(this); | 5809 if (!IsTableSection()) { |
5810 if (!cell->Row()->IsFirstRowInSectionAfterHeader()) | 5810 LayoutState* layout_state = View()->GetLayoutState(); |
5811 strut_to_next_page += cell->Table()->RowOffsetFromRepeatingHeader(); | 5811 strut_to_next_page += layout_state->HeightOffsetForTableHeaders(); |
5812 } | 5812 } |
| 5813 |
5813 LayoutUnit next_page_logical_top = offset + strut_to_next_page; | 5814 LayoutUnit next_page_logical_top = offset + strut_to_next_page; |
5814 if (PageLogicalHeightForOffset(next_page_logical_top) >= | 5815 if (PageLogicalHeightForOffset(next_page_logical_top) >= |
5815 content_logical_height) | 5816 content_logical_height) |
5816 return strut_to_next_page; // Content fits just fine in the next page or | 5817 return strut_to_next_page; // Content fits just fine in the next page or |
5817 // column. | 5818 // column. |
5818 | 5819 |
5819 // Moving to the top of the next page or column doesn't result in enough space | 5820 // Moving to the top of the next page or column doesn't result in enough space |
5820 // for the content that we're trying to fit. If we're in a nested | 5821 // for the content that we're trying to fit. If we're in a nested |
5821 // fragmentation context, we may find enough space if we move to a column | 5822 // fragmentation context, we may find enough space if we move to a column |
5822 // further ahead, by effectively breaking to the next outer fragmentainer. | 5823 // further ahead, by effectively breaking to the next outer fragmentainer. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5893 void LayoutBox::MutableForPainting:: | 5894 void LayoutBox::MutableForPainting:: |
5894 SavePreviousContentBoxSizeAndLayoutOverflowRect() { | 5895 SavePreviousContentBoxSizeAndLayoutOverflowRect() { |
5895 auto& rare_data = GetLayoutBox().EnsureRareData(); | 5896 auto& rare_data = GetLayoutBox().EnsureRareData(); |
5896 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true; | 5897 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true; |
5897 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size(); | 5898 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size(); |
5898 rare_data.previous_layout_overflow_rect_ = | 5899 rare_data.previous_layout_overflow_rect_ = |
5899 GetLayoutBox().LayoutOverflowRect(); | 5900 GetLayoutBox().LayoutOverflowRect(); |
5900 } | 5901 } |
5901 | 5902 |
5902 } // namespace blink | 5903 } // namespace blink |
OLD | NEW |