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 18 matching lines...) Expand all Loading... |
29 #include "core/rendering/RenderInline.h" | 29 #include "core/rendering/RenderInline.h" |
30 #include "core/rendering/RenderLayer.h" | 30 #include "core/rendering/RenderLayer.h" |
31 #include "core/rendering/RenderView.h" | 31 #include "core/rendering/RenderView.h" |
32 #include "platform/Partitions.h" | 32 #include "platform/Partitions.h" |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 LayoutState::LayoutState(LayoutState* prev, RenderBox& renderer, const LayoutSiz
e& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged, ColumnIn
fo* columnInfo) | 36 LayoutState::LayoutState(LayoutState* prev, RenderBox& renderer, const LayoutSiz
e& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged, ColumnIn
fo* columnInfo) |
37 : m_columnInfo(columnInfo) | 37 : m_columnInfo(columnInfo) |
38 , m_next(prev) | 38 , m_next(prev) |
39 , m_shapeInsideInfo(0) | |
40 #ifndef NDEBUG | 39 #ifndef NDEBUG |
41 , m_renderer(&renderer) | 40 , m_renderer(&renderer) |
42 #endif | 41 #endif |
43 { | 42 { |
44 ASSERT(m_next); | 43 ASSERT(m_next); |
45 | 44 |
46 bool fixed = renderer.isOutOfFlowPositioned() && renderer.style()->position(
) == FixedPosition; | 45 bool fixed = renderer.isOutOfFlowPositioned() && renderer.style()->position(
) == FixedPosition; |
47 if (fixed) { | 46 if (fixed) { |
48 // FIXME: This doesn't work correctly with transforms. | 47 // FIXME: This doesn't work correctly with transforms. |
49 FloatPoint fixedOffset = renderer.view()->localToAbsolute(FloatPoint(),
IsFixed); | 48 FloatPoint fixedOffset = renderer.view()->localToAbsolute(FloatPoint(),
IsFixed); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 96 |
98 // Disable pagination for objects we don't support. For now this include
s overflow:scroll/auto, inline blocks and | 97 // Disable pagination for objects we don't support. For now this include
s overflow:scroll/auto, inline blocks and |
99 // writing mode roots. | 98 // writing mode roots. |
100 if (renderer.isUnsplittableForPagination()) | 99 if (renderer.isUnsplittableForPagination()) |
101 m_pageLogicalHeight = 0; | 100 m_pageLogicalHeight = 0; |
102 } | 101 } |
103 | 102 |
104 if (!m_columnInfo) | 103 if (!m_columnInfo) |
105 m_columnInfo = m_next->m_columnInfo; | 104 m_columnInfo = m_next->m_columnInfo; |
106 | 105 |
107 if (renderer.isRenderBlock()) { | |
108 const RenderBlock& renderBlock = toRenderBlock(renderer); | |
109 m_shapeInsideInfo = renderBlock.shapeInsideInfo(); | |
110 if (!m_shapeInsideInfo && m_next->m_shapeInsideInfo && renderBlock.allow
sShapeInsideInfoSharing(&m_next->m_shapeInsideInfo->owner())) | |
111 m_shapeInsideInfo = m_next->m_shapeInsideInfo; | |
112 } | |
113 | |
114 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { | 106 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
115 m_layoutDelta = m_next->m_layoutDelta; | 107 m_layoutDelta = m_next->m_layoutDelta; |
116 #if !ASSERT_DISABLED | 108 #if !ASSERT_DISABLED |
117 m_layoutDeltaXSaturated = m_next->m_layoutDeltaXSaturated; | 109 m_layoutDeltaXSaturated = m_next->m_layoutDeltaXSaturated; |
118 m_layoutDeltaYSaturated = m_next->m_layoutDeltaYSaturated; | 110 m_layoutDeltaYSaturated = m_next->m_layoutDeltaYSaturated; |
119 #endif | 111 #endif |
120 } | 112 } |
121 | 113 |
122 m_isPaginated = m_pageLogicalHeight || m_columnInfo || renderer.isRenderFlow
Thread(); | 114 m_isPaginated = m_pageLogicalHeight || m_columnInfo || renderer.isRenderFlow
Thread(); |
123 | 115 |
124 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip
if present. | 116 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip
if present. |
125 } | 117 } |
126 | 118 |
127 LayoutState::LayoutState(RenderObject& root) | 119 LayoutState::LayoutState(RenderObject& root) |
128 : m_clipped(false) | 120 : m_clipped(false) |
129 , m_isPaginated(false) | 121 , m_isPaginated(false) |
130 , m_pageLogicalHeightChanged(false) | 122 , m_pageLogicalHeightChanged(false) |
131 #if !ASSERT_DISABLED | 123 #if !ASSERT_DISABLED |
132 , m_layoutDeltaXSaturated(false) | 124 , m_layoutDeltaXSaturated(false) |
133 , m_layoutDeltaYSaturated(false) | 125 , m_layoutDeltaYSaturated(false) |
134 #endif | 126 #endif |
135 , m_columnInfo(0) | 127 , m_columnInfo(0) |
136 , m_next(0) | 128 , m_next(0) |
137 , m_shapeInsideInfo(0) | |
138 , m_pageLogicalHeight(0) | 129 , m_pageLogicalHeight(0) |
139 #ifndef NDEBUG | 130 #ifndef NDEBUG |
140 , m_renderer(&root) | 131 , m_renderer(&root) |
141 #endif | 132 #endif |
142 { | 133 { |
143 RenderObject* container = root.container(); | 134 RenderObject* container = root.container(); |
144 FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), UseTra
nsforms); | 135 FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), UseTra
nsforms); |
145 m_paintOffset = LayoutSize(absContentPoint.x(), absContentPoint.y()); | 136 m_paintOffset = LayoutSize(absContentPoint.x(), absContentPoint.y()); |
146 | 137 |
147 if (container->hasOverflowClip()) { | 138 if (container->hasOverflowClip()) { |
(...skipping 29 matching lines...) Expand all Loading... |
177 } | 168 } |
178 | 169 |
179 void LayoutState::addForcedColumnBreak(const RenderBox& child, const LayoutUnit&
childLogicalOffset) | 170 void LayoutState::addForcedColumnBreak(const RenderBox& child, const LayoutUnit&
childLogicalOffset) |
180 { | 171 { |
181 if (!m_columnInfo || m_columnInfo->columnHeight()) | 172 if (!m_columnInfo || m_columnInfo->columnHeight()) |
182 return; | 173 return; |
183 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); | 174 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); |
184 } | 175 } |
185 | 176 |
186 } // namespace WebCore | 177 } // namespace WebCore |
OLD | NEW |