OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 // If we establish a new page height, then cache the offset to the top of th
e first page. | 77 // If we establish a new page height, then cache the offset to the top of th
e first page. |
78 // We can compare this later on to figure out what part of the page we're ac
tually on, | 78 // We can compare this later on to figure out what part of the page we're ac
tually on, |
79 if (pageLogicalHeight || m_columnInfo || layoutObject.isLayoutFlowThread())
{ | 79 if (pageLogicalHeight || m_columnInfo || layoutObject.isLayoutFlowThread())
{ |
80 m_pageLogicalHeight = pageLogicalHeight; | 80 m_pageLogicalHeight = pageLogicalHeight; |
81 bool isFlipped = layoutObject.style()->isFlippedBlocksWritingMode(); | 81 bool isFlipped = layoutObject.style()->isFlippedBlocksWritingMode(); |
82 m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? layoutO
bject.borderLeft() + layoutObject.paddingLeft() : layoutObject.borderRight() + l
ayoutObject.paddingRight()), | 82 m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? layoutO
bject.borderLeft() + layoutObject.paddingLeft() : layoutObject.borderRight() + l
ayoutObject.paddingRight()), |
83 m_layoutOffset.height() + (!isFlipped ? layoutObject.borderTop() + l
ayoutObject.paddingTop() : layoutObject.borderBottom() + layoutObject.paddingBot
tom())); | 83 m_layoutOffset.height() + (!isFlipped ? layoutObject.borderTop() + l
ayoutObject.paddingTop() : layoutObject.borderBottom() + layoutObject.paddingBot
tom())); |
84 m_pageLogicalHeightChanged = pageLogicalHeightChanged; | 84 m_pageLogicalHeightChanged = pageLogicalHeightChanged; |
85 m_isPaginated = true; | 85 m_isPaginated = true; |
| 86 } else if (m_layoutObject.isSVG() && !m_layoutObject.isSVGRoot()) { |
| 87 // Pagination inside SVG is not allowed. |
| 88 m_flowThread = nullptr; |
| 89 ASSERT(!m_isPaginated); |
86 } else { | 90 } else { |
87 // If we don't establish a new page height, then propagate the old page
height and offset down. | 91 // If we don't establish a new page height, then propagate the old page
height and offset down. |
88 m_pageLogicalHeight = m_next->m_pageLogicalHeight; | 92 m_pageLogicalHeight = m_next->m_pageLogicalHeight; |
89 m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged; | 93 m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged; |
90 m_pageOffset = m_next->m_pageOffset; | 94 m_pageOffset = m_next->m_pageOffset; |
91 | 95 |
92 // Disable pagination for objects we don't support. For now this include
s overflow:scroll/auto, inline blocks and | 96 // Disable pagination for objects we don't support. For now this include
s overflow:scroll/auto, inline blocks and |
93 // writing mode roots. | 97 // writing mode roots. |
94 if (layoutObject.isUnsplittableForPagination()) { | 98 if (layoutObject.isUnsplittableForPagination()) { |
95 m_pageLogicalHeight = 0; | 99 m_pageLogicalHeight = 0; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 154 } |
151 | 155 |
152 void LayoutState::addForcedColumnBreak(const LayoutBox& child, const LayoutUnit&
childLogicalOffset) | 156 void LayoutState::addForcedColumnBreak(const LayoutBox& child, const LayoutUnit&
childLogicalOffset) |
153 { | 157 { |
154 if (!m_columnInfo || m_columnInfo->columnHeight()) | 158 if (!m_columnInfo || m_columnInfo->columnHeight()) |
155 return; | 159 return; |
156 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); | 160 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); |
157 } | 161 } |
158 | 162 |
159 } // namespace blink | 163 } // namespace blink |
OLD | NEW |