| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 // If we establish a new page height, then cache the offset to the top of th
e first page. | 84 // If we establish a new page height, then cache the offset to the top of th
e first page. |
| 85 // We can compare this later on to figure out what part of the page we're ac
tually on, | 85 // We can compare this later on to figure out what part of the page we're ac
tually on, |
| 86 if (pageLogicalHeight || m_columnInfo || renderer.isRenderFlowThread()) { | 86 if (pageLogicalHeight || m_columnInfo || renderer.isRenderFlowThread()) { |
| 87 m_pageLogicalHeight = pageLogicalHeight; | 87 m_pageLogicalHeight = pageLogicalHeight; |
| 88 bool isFlipped = renderer.style()->isFlippedBlocksWritingMode(); | 88 bool isFlipped = renderer.style()->isFlippedBlocksWritingMode(); |
| 89 m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? rendere
r.borderLeft() + renderer.paddingLeft() : renderer.borderRight() + renderer.padd
ingRight()), | 89 m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? rendere
r.borderLeft() + renderer.paddingLeft() : renderer.borderRight() + renderer.padd
ingRight()), |
| 90 m_layoutOffset.height() + (!isFlipped ? renderer.borderTop() + rende
rer.paddingTop() : renderer.borderBottom() + renderer.paddingBottom())); | 90 m_layoutOffset.height() + (!isFlipped ? renderer.borderTop() + rende
rer.paddingTop() : renderer.borderBottom() + renderer.paddingBottom())); |
| 91 m_pageLogicalHeightChanged = pageLogicalHeightChanged; | 91 m_pageLogicalHeightChanged = pageLogicalHeightChanged; |
| 92 m_isPaginated = true; |
| 92 } else { | 93 } else { |
| 93 // If we don't establish a new page height, then propagate the old page
height and offset down. | 94 // If we don't establish a new page height, then propagate the old page
height and offset down. |
| 94 m_pageLogicalHeight = m_next->m_pageLogicalHeight; | 95 m_pageLogicalHeight = m_next->m_pageLogicalHeight; |
| 95 m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged; | 96 m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged; |
| 96 m_pageOffset = m_next->m_pageOffset; | 97 m_pageOffset = m_next->m_pageOffset; |
| 97 | 98 |
| 98 // Disable pagination for objects we don't support. For now this include
s overflow:scroll/auto, inline blocks and | 99 // Disable pagination for objects we don't support. For now this include
s overflow:scroll/auto, inline blocks and |
| 99 // writing mode roots. | 100 // writing mode roots. |
| 100 if (renderer.isUnsplittableForPagination()) | 101 if (renderer.isUnsplittableForPagination()) { |
| 101 m_pageLogicalHeight = 0; | 102 m_pageLogicalHeight = 0; |
| 103 m_isPaginated = false; |
| 104 } else { |
| 105 m_isPaginated = m_pageLogicalHeight || m_next->m_columnInfo || rende
rer.flowThreadContainingBlock(); |
| 106 } |
| 102 } | 107 } |
| 103 | 108 |
| 104 if (!m_columnInfo) | 109 if (!m_columnInfo) |
| 105 m_columnInfo = m_next->m_columnInfo; | 110 m_columnInfo = m_next->m_columnInfo; |
| 106 | 111 |
| 107 if (renderer.isRenderBlock()) { | 112 if (renderer.isRenderBlock()) { |
| 108 const RenderBlock& renderBlock = toRenderBlock(renderer); | 113 const RenderBlock& renderBlock = toRenderBlock(renderer); |
| 109 m_shapeInsideInfo = renderBlock.shapeInsideInfo(); | 114 m_shapeInsideInfo = renderBlock.shapeInsideInfo(); |
| 110 if (!m_shapeInsideInfo && m_next->m_shapeInsideInfo && renderBlock.allow
sShapeInsideInfoSharing(&m_next->m_shapeInsideInfo->owner())) | 115 if (!m_shapeInsideInfo && m_next->m_shapeInsideInfo && renderBlock.allow
sShapeInsideInfoSharing(&m_next->m_shapeInsideInfo->owner())) |
| 111 m_shapeInsideInfo = m_next->m_shapeInsideInfo; | 116 m_shapeInsideInfo = m_next->m_shapeInsideInfo; |
| 112 } | 117 } |
| 113 | 118 |
| 114 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { | 119 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
| 115 m_layoutDelta = m_next->m_layoutDelta; | 120 m_layoutDelta = m_next->m_layoutDelta; |
| 116 #if !ASSERT_DISABLED | 121 #if !ASSERT_DISABLED |
| 117 m_layoutDeltaXSaturated = m_next->m_layoutDeltaXSaturated; | 122 m_layoutDeltaXSaturated = m_next->m_layoutDeltaXSaturated; |
| 118 m_layoutDeltaYSaturated = m_next->m_layoutDeltaYSaturated; | 123 m_layoutDeltaYSaturated = m_next->m_layoutDeltaYSaturated; |
| 119 #endif | 124 #endif |
| 120 } | 125 } |
| 121 | 126 |
| 122 m_isPaginated = m_pageLogicalHeight || m_columnInfo || renderer.isRenderFlow
Thread(); | |
| 123 | |
| 124 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip
if present. | 127 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip
if present. |
| 125 } | 128 } |
| 126 | 129 |
| 127 LayoutState::LayoutState(RenderObject& root) | 130 LayoutState::LayoutState(RenderObject& root) |
| 128 : m_clipped(false) | 131 : m_clipped(false) |
| 129 , m_isPaginated(false) | 132 , m_isPaginated(false) |
| 130 , m_pageLogicalHeightChanged(false) | 133 , m_pageLogicalHeightChanged(false) |
| 131 #if !ASSERT_DISABLED | 134 #if !ASSERT_DISABLED |
| 132 , m_layoutDeltaXSaturated(false) | 135 , m_layoutDeltaXSaturated(false) |
| 133 , m_layoutDeltaYSaturated(false) | 136 , m_layoutDeltaYSaturated(false) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 180 } |
| 178 | 181 |
| 179 void LayoutState::addForcedColumnBreak(const RenderBox& child, const LayoutUnit&
childLogicalOffset) | 182 void LayoutState::addForcedColumnBreak(const RenderBox& child, const LayoutUnit&
childLogicalOffset) |
| 180 { | 183 { |
| 181 if (!m_columnInfo || m_columnInfo->columnHeight()) | 184 if (!m_columnInfo || m_columnInfo->columnHeight()) |
| 182 return; | 185 return; |
| 183 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); | 186 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); |
| 184 } | 187 } |
| 185 | 188 |
| 186 } // namespace WebCore | 189 } // namespace WebCore |
| OLD | NEW |