Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: Source/core/rendering/RenderView.cpp

Issue 18601002: Add infrastructure for partial layouts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: define RenderObject::frameView in the header Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderView.h ('k') | Source/core/rendering/SubtreeLayoutScope.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 { 113 {
114 return child->isBox(); 114 return child->isBox();
115 } 115 }
116 116
117 void RenderView::layoutContent(const LayoutState& state) 117 void RenderView::layoutContent(const LayoutState& state)
118 { 118 {
119 UNUSED_PARAM(state); 119 UNUSED_PARAM(state);
120 ASSERT(needsLayout()); 120 ASSERT(needsLayout());
121 121
122 RenderBlock::layout(); 122 RenderBlock::layout();
123
124 if (m_frameView->partialLayout().isStopping())
125 return;
126
123 if (hasRenderNamedFlowThreads()) 127 if (hasRenderNamedFlowThreads())
124 flowThreadController()->layoutRenderNamedFlowThreads(); 128 flowThreadController()->layoutRenderNamedFlowThreads();
129
125 #ifndef NDEBUG 130 #ifndef NDEBUG
126 checkLayoutState(state); 131 checkLayoutState(state);
127 #endif 132 #endif
128 } 133 }
129 134
130 #ifndef NDEBUG 135 #ifndef NDEBUG
131 void RenderView::checkLayoutState(const LayoutState& state) 136 void RenderView::checkLayoutState(const LayoutState& state)
132 { 137 {
133 ASSERT(layoutDeltaMatches(LayoutSize())); 138 ASSERT(layoutDeltaMatches(LayoutSize()));
134 ASSERT(!m_layoutStateDisableCount); 139 ASSERT(!m_layoutStateDisableCount);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // 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 210 // 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
206 // inner flows have the necessary information to correctly fragment the content. 211 // inner flows have the necessary information to correctly fragment the content.
207 // 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 212 // 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
208 // 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 213 // 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
209 // belonging to inner flows. This step will correctly set the computedAutoHeight for the auto-height regions. It's possible for non-auto-height 214 // belonging to inner flows. This step will correctly set the computedAutoHeight for the auto-height regions. It's possible for non-auto-height
210 // regions to relayout if they depend on auto-height regions. This will invalida te the inner flow threads and mark them as needing layout. 215 // regions to relayout if they depend on auto-height regions. This will invalida te the inner flow threads and mark them as needing layout.
211 // 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 216 // 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
212 // as detected in the previous step. 217 // as detected in the previous step.
213 void RenderView::layoutContentInAutoLogicalHeightRegions(const LayoutState& stat e) 218 void RenderView::layoutContentInAutoLogicalHeightRegions(const LayoutState& stat e)
214 { 219 {
220 if (!m_frameView->partialLayout().isStopping()) {
221 // Disable partial layout for any two-pass layout algorithm.
222 m_frameView->partialLayout().reset();
223 }
224
215 // We need to invalidate all the flows with auto-height regions if one such flow needs layout. 225 // We need to invalidate all the flows with auto-height regions if one such flow needs layout.
216 // If none is found we do a layout a check back again afterwards. 226 // If none is found we do a layout a check back again afterwards.
217 if (!flowThreadController()->updateFlowThreadsNeedingLayout()) { 227 if (!flowThreadController()->updateFlowThreadsNeedingLayout()) {
218 // 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). 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).
219 layoutContent(state); 229 layoutContent(state);
220 230
221 // If we find no named flow needing a two step layout after the first la yout, exit early. 231 // If we find no named flow needing a two step layout after the first la yout, exit early.
222 // Otherwise, initiate the two step layout algorithm and recompute all t he flows. 232 // Otherwise, initiate the two step layout algorithm and recompute all t he flows.
223 if (!flowThreadController()->updateFlowThreadsNeedingTwoStepLayout()) 233 if (!flowThreadController()->updateFlowThreadsNeedingTwoStepLayout())
224 return; 234 return;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 bool isSeamlessAncestorInFlowThread = initializeLayoutState(state); 283 bool isSeamlessAncestorInFlowThread = initializeLayoutState(state);
274 284
275 m_pageLogicalHeightChanged = false; 285 m_pageLogicalHeightChanged = false;
276 m_layoutState = &state; 286 m_layoutState = &state;
277 287
278 if (checkTwoPassLayoutForAutoHeightRegions()) 288 if (checkTwoPassLayoutForAutoHeightRegions())
279 layoutContentInAutoLogicalHeightRegions(state); 289 layoutContentInAutoLogicalHeightRegions(state);
280 else 290 else
281 layoutContent(state); 291 layoutContent(state);
282 292
293 if (m_frameView->partialLayout().isStopping()) {
294 m_layoutState = 0;
295 return;
296 }
297
283 #ifndef NDEBUG 298 #ifndef NDEBUG
284 checkLayoutState(state); 299 checkLayoutState(state);
285 #endif 300 #endif
286 m_layoutState = 0; 301 m_layoutState = 0;
287 clearNeedsLayout(); 302 clearNeedsLayout();
288 303
289 if (isSeamlessAncestorInFlowThread) 304 if (isSeamlessAncestorInFlowThread)
290 flowThreadController()->setCurrentRenderFlowThread(0); 305 flowThreadController()->setCurrentRenderFlowThread(0);
291 } 306 }
292 307
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 #endif 1164 #endif
1150 1165
1151 if (layoutState) 1166 if (layoutState)
1152 layoutState->m_isPaginated = m_fragmenting; 1167 layoutState->m_isPaginated = m_fragmenting;
1153 1168
1154 if (m_flowThreadState != RenderObject::NotInsideFlowThread) 1169 if (m_flowThreadState != RenderObject::NotInsideFlowThread)
1155 m_root->setFlowThreadStateIncludingDescendants(m_flowThreadState); 1170 m_root->setFlowThreadStateIncludingDescendants(m_flowThreadState);
1156 } 1171 }
1157 1172
1158 } // namespace WebCore 1173 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderView.h ('k') | Source/core/rendering/SubtreeLayoutScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698