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

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: Address reviewer comments Created 7 years, 4 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
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->shouldStopPartialLayout())
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 // 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 212 // 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
208 // inner flows have the necessary information to correctly fragment the content. 213 // inner flows have the necessary information to correctly fragment the content.
209 // 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 214 // 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
210 // 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 215 // 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
211 // belonging to inner flows. This step will correctly set the computedAutoHeight for the auto-height regions. It's possible for non-auto-height 216 // belonging to inner flows. This step will correctly set the computedAutoHeight for the auto-height regions. It's possible for non-auto-height
212 // regions to relayout if they depend on auto-height regions. This will invalida te the inner flow threads and mark them as needing layout. 217 // regions to relayout if they depend on auto-height regions. This will invalida te the inner flow threads and mark them as needing layout.
213 // 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 218 // 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
214 // as detected in the previous step. 219 // as detected in the previous step.
215 void RenderView::layoutContentInAutoLogicalHeightRegions(const LayoutState& stat e) 220 void RenderView::layoutContentInAutoLogicalHeightRegions(const LayoutState& stat e)
216 { 221 {
222 if (!m_frameView->shouldStopPartialLayout()) {
223 // disable partial layout for any two-pass layout algorithm.
224 m_frameView->resetPartialLayoutState();
225 }
226
217 // We need to invalidate all the flows with auto-height regions if one such flow needs layout. 227 // We need to invalidate all the flows with auto-height regions if one such flow needs layout.
218 // If none is found we do a layout a check back again afterwards. 228 // If none is found we do a layout a check back again afterwards.
219 if (!flowThreadController()->updateFlowThreadsNeedingLayout()) { 229 if (!flowThreadController()->updateFlowThreadsNeedingLayout()) {
220 // 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). 230 // 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).
221 layoutContent(state); 231 layoutContent(state);
222 232
223 // If we find no named flow needing a two step layout after the first la yout, exit early. 233 // If we find no named flow needing a two step layout after the first la yout, exit early.
224 // Otherwise, initiate the two step layout algorithm and recompute all t he flows. 234 // Otherwise, initiate the two step layout algorithm and recompute all t he flows.
225 if (!flowThreadController()->updateFlowThreadsNeedingTwoStepLayout()) 235 if (!flowThreadController()->updateFlowThreadsNeedingTwoStepLayout())
226 return; 236 return;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 bool isSeamlessAncestorInFlowThread = initializeLayoutState(state); 286 bool isSeamlessAncestorInFlowThread = initializeLayoutState(state);
277 287
278 m_pageLogicalHeightChanged = false; 288 m_pageLogicalHeightChanged = false;
279 m_layoutState = &state; 289 m_layoutState = &state;
280 290
281 if (checkTwoPassLayoutForAutoHeightRegions()) 291 if (checkTwoPassLayoutForAutoHeightRegions())
282 layoutContentInAutoLogicalHeightRegions(state); 292 layoutContentInAutoLogicalHeightRegions(state);
283 else 293 else
284 layoutContent(state); 294 layoutContent(state);
285 295
296 if (m_frameView->shouldStopPartialLayout()) {
297 m_layoutState = 0;
298 return;
299 }
300
286 #ifndef NDEBUG 301 #ifndef NDEBUG
287 checkLayoutState(state); 302 checkLayoutState(state);
288 #endif 303 #endif
289 m_layoutState = 0; 304 m_layoutState = 0;
290 clearNeedsLayout(); 305 clearNeedsLayout();
291 306
292 if (isSeamlessAncestorInFlowThread) 307 if (isSeamlessAncestorInFlowThread)
293 flowThreadController()->setCurrentRenderFlowThread(0); 308 flowThreadController()->setCurrentRenderFlowThread(0);
294 } 309 }
295 310
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 #endif 1157 #endif
1143 1158
1144 if (layoutState) 1159 if (layoutState)
1145 layoutState->m_isPaginated = m_fragmenting; 1160 layoutState->m_isPaginated = m_fragmenting;
1146 1161
1147 if (m_flowThreadState != RenderObject::NotInsideFlowThread) 1162 if (m_flowThreadState != RenderObject::NotInsideFlowThread)
1148 m_root->setFlowThreadStateIncludingDescendants(m_flowThreadState); 1163 m_root->setFlowThreadStateIncludingDescendants(m_flowThreadState);
1149 } 1164 }
1150 1165
1151 } // namespace WebCore 1166 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698