| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 for (RenderLazyBlock* block = m_firstLazyBlock; block; block = block->next()
) | 121 for (RenderLazyBlock* block = m_firstLazyBlock; block; block = block->next()
) |
| 122 block->setNeedsLayout(); | 122 block->setNeedsLayout(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void RenderView::layoutContent(const LayoutState& state) | 125 void RenderView::layoutContent(const LayoutState& state) |
| 126 { | 126 { |
| 127 UNUSED_PARAM(state); | 127 UNUSED_PARAM(state); |
| 128 ASSERT(needsLayout()); | 128 ASSERT(needsLayout()); |
| 129 | 129 |
| 130 RenderBlock::layout(); | 130 RenderBlock::layout(); |
| 131 |
| 132 if (m_frameView->canStopPartialLayout()) |
| 133 return; |
| 134 |
| 131 if (hasRenderNamedFlowThreads()) | 135 if (hasRenderNamedFlowThreads()) |
| 132 flowThreadController()->layoutRenderNamedFlowThreads(); | 136 flowThreadController()->layoutRenderNamedFlowThreads(); |
| 137 |
| 133 #ifndef NDEBUG | 138 #ifndef NDEBUG |
| 134 checkLayoutState(state); | 139 checkLayoutState(state); |
| 135 #endif | 140 #endif |
| 136 } | 141 } |
| 137 | 142 |
| 138 #ifndef NDEBUG | 143 #ifndef NDEBUG |
| 139 void RenderView::checkLayoutState(const LayoutState& state) | 144 void RenderView::checkLayoutState(const LayoutState& state) |
| 140 { | 145 { |
| 141 ASSERT(layoutDeltaMatches(LayoutSize())); | 146 ASSERT(layoutDeltaMatches(LayoutSize())); |
| 142 ASSERT(!m_layoutStateDisableCount); | 147 ASSERT(!m_layoutStateDisableCount); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // 1. The flows are laid out from the outer flow to the inner flow. This success
fully computes the outer non-auto-height regions size so the | 220 // 1. The flows are laid out from the outer flow to the inner flow. This success
fully computes the outer non-auto-height regions size so the |
| 216 // inner flows have the necessary information to correctly fragment the content. | 221 // inner flows have the necessary information to correctly fragment the content. |
| 217 // 2. The flows are laid out from the inner flow to the outer flow. After an inn
er flow is laid out it goes into the constrained layout phase | 222 // 2. The flows are laid out from the inner flow to the outer flow. After an inn
er flow is laid out it goes into the constrained layout phase |
| 218 // and marks the auto-height regions they need layout. This means the outer flow
s will relayout if they depend on regions with auto-height regions | 223 // and marks the auto-height regions they need layout. This means the outer flow
s will relayout if they depend on regions with auto-height regions |
| 219 // belonging to inner flows. This step will correctly set the computedAutoHeight
for the auto-height regions. It's possible for non-auto-height | 224 // belonging to inner flows. This step will correctly set the computedAutoHeight
for the auto-height regions. It's possible for non-auto-height |
| 220 // regions to relayout if they depend on auto-height regions. This will invalida
te the inner flow threads and mark them as needing layout. | 225 // regions to relayout if they depend on auto-height regions. This will invalida
te the inner flow threads and mark them as needing layout. |
| 221 // 3. The last step is to do one last layout if there are pathological dependenc
ies between non-auto-height regions and auto-height regions | 226 // 3. The last step is to do one last layout if there are pathological dependenc
ies between non-auto-height regions and auto-height regions |
| 222 // as detected in the previous step. | 227 // as detected in the previous step. |
| 223 void RenderView::layoutContentInAutoLogicalHeightRegions(const LayoutState& stat
e) | 228 void RenderView::layoutContentInAutoLogicalHeightRegions(const LayoutState& stat
e) |
| 224 { | 229 { |
| 230 if (!m_frameView->canStopPartialLayout()) { |
| 231 // disable partial layout for any two-pass layout algorithm. |
| 232 m_frameView->resetPartialLayoutState(); |
| 233 } |
| 234 |
| 225 // We need to invalidate all the flows with auto-height regions if one such
flow needs layout. | 235 // We need to invalidate all the flows with auto-height regions if one such
flow needs layout. |
| 226 // If none is found we do a layout a check back again afterwards. | 236 // If none is found we do a layout a check back again afterwards. |
| 227 if (!flowThreadController()->updateFlowThreadsNeedingLayout()) { | 237 if (!flowThreadController()->updateFlowThreadsNeedingLayout()) { |
| 228 // Do a first layout of the content. In some cases more layouts are not
needed (e.g. only flows with non-auto-height regions have changed). | 238 // Do a first layout of the content. In some cases more layouts are not
needed (e.g. only flows with non-auto-height regions have changed). |
| 229 layoutContent(state); | 239 layoutContent(state); |
| 230 | 240 |
| 231 // If we find no named flow needing a two step layout after the first la
yout, exit early. | 241 // If we find no named flow needing a two step layout after the first la
yout, exit early. |
| 232 // Otherwise, initiate the two step layout algorithm and recompute all t
he flows. | 242 // Otherwise, initiate the two step layout algorithm and recompute all t
he flows. |
| 233 if (!flowThreadController()->updateFlowThreadsNeedingTwoStepLayout()) | 243 if (!flowThreadController()->updateFlowThreadsNeedingTwoStepLayout()) |
| 234 return; | 244 return; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 bool isSeamlessAncestorInFlowThread = initializeLayoutState(state); | 292 bool isSeamlessAncestorInFlowThread = initializeLayoutState(state); |
| 283 | 293 |
| 284 m_pageLogicalHeightChanged = false; | 294 m_pageLogicalHeightChanged = false; |
| 285 m_layoutState = &state; | 295 m_layoutState = &state; |
| 286 | 296 |
| 287 if (checkTwoPassLayoutForAutoHeightRegions()) | 297 if (checkTwoPassLayoutForAutoHeightRegions()) |
| 288 layoutContentInAutoLogicalHeightRegions(state); | 298 layoutContentInAutoLogicalHeightRegions(state); |
| 289 else | 299 else |
| 290 layoutContent(state); | 300 layoutContent(state); |
| 291 | 301 |
| 302 if (m_frameView->canStopPartialLayout()) { |
| 303 m_layoutState = 0; |
| 304 return; |
| 305 } |
| 306 |
| 292 #ifndef NDEBUG | 307 #ifndef NDEBUG |
| 293 checkLayoutState(state); | 308 checkLayoutState(state); |
| 294 #endif | 309 #endif |
| 295 m_layoutState = 0; | 310 m_layoutState = 0; |
| 296 clearNeedsLayout(); | 311 clearNeedsLayout(); |
| 297 | 312 |
| 298 if (isSeamlessAncestorInFlowThread) | 313 if (isSeamlessAncestorInFlowThread) |
| 299 flowThreadController()->setCurrentRenderFlowThread(0); | 314 flowThreadController()->setCurrentRenderFlowThread(0); |
| 300 } | 315 } |
| 301 | 316 |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 #endif | 1163 #endif |
| 1149 | 1164 |
| 1150 if (layoutState) | 1165 if (layoutState) |
| 1151 layoutState->m_isPaginated = m_fragmenting; | 1166 layoutState->m_isPaginated = m_fragmenting; |
| 1152 | 1167 |
| 1153 if (m_flowThreadState != RenderObject::NotInsideFlowThread) | 1168 if (m_flowThreadState != RenderObject::NotInsideFlowThread) |
| 1154 m_root->setFlowThreadStateIncludingDescendants(m_flowThreadState); | 1169 m_root->setFlowThreadStateIncludingDescendants(m_flowThreadState); |
| 1155 } | 1170 } |
| 1156 | 1171 |
| 1157 } // namespace WebCore | 1172 } // namespace WebCore |
| OLD | NEW |