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

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

Issue 196533012: Make LayoutState always be RAII (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix FlexBox LayoutState scoping Created 6 years, 9 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 * This file is part of the render object implementation for KHTML. 2 * This file is part of the render object implementation for KHTML.
3 * 3 *
4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
5 * (C) 1999 Antti Koivisto (koivisto@kde.org) 5 * (C) 1999 Antti Koivisto (koivisto@kde.org)
6 * Copyright (C) 2003 Apple Computer, Inc. 6 * Copyright (C) 2003 Apple Computer, Inc.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 251 }
252 252
253 void RenderDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren) 253 void RenderDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren)
254 { 254 {
255 ASSERT(needsLayout()); 255 ASSERT(needsLayout());
256 256
257 if (!relayoutChildren && simplifiedLayout()) 257 if (!relayoutChildren && simplifiedLayout())
258 return; 258 return;
259 259
260 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); 260 LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
261 LayoutStateMaintainer statePusher(*this, locationOffset());
262 261
263 RenderFlowThread* flowThread = flowThreadContainingBlock(); 262 {
264 if (updateRegionsAndShapesLogicalSize(flowThread)) 263 // LayoutStateMaintainer needs this deliberate scope to pop before repai nt
esprehn 2014/03/20 01:10:55 We might try refactoring these functions so that w
265 relayoutChildren = true; 264 LayoutStateMaintainer statePusher(*this, locationOffset());
266 265
267 LayoutSize previousSize = size(); 266 RenderFlowThread* flowThread = flowThreadContainingBlock();
267 if (updateRegionsAndShapesLogicalSize(flowThread))
268 relayoutChildren = true;
268 269
269 updateLogicalWidth(); 270 LayoutSize previousSize = size();
270 updateLogicalHeight();
271 271
272 if (previousSize != size() 272 updateLogicalWidth();
273 || (parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient( ) == HORIZONTAL 273 updateLogicalHeight();
274 && parent()->style()->boxAlign() == BSTRETCH))
275 relayoutChildren = true;
276 274
277 setHeight(0); 275 if (previousSize != size()
276 || (parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOri ent() == HORIZONTAL
277 && parent()->style()->boxAlign() == BSTRETCH))
278 relayoutChildren = true;
278 279
279 m_stretchingChildren = false; 280 setHeight(0);
280 281
281 if (isHorizontal()) 282 m_stretchingChildren = false;
282 layoutHorizontalBox(relayoutChildren);
283 else
284 layoutVerticalBox(relayoutChildren);
285 283
286 LayoutUnit oldClientAfterEdge = clientLogicalBottom(); 284 if (isHorizontal())
287 updateLogicalHeight(); 285 layoutHorizontalBox(relayoutChildren);
286 else
287 layoutVerticalBox(relayoutChildren);
288 288
289 if (previousSize.height() != height()) 289 LayoutUnit oldClientAfterEdge = clientLogicalBottom();
290 relayoutChildren = true; 290 updateLogicalHeight();
291 291
292 layoutPositionedObjects(relayoutChildren || isRoot()); 292 if (previousSize.height() != height())
293 relayoutChildren = true;
293 294
294 computeRegionRangeForBlock(flowThread); 295 layoutPositionedObjects(relayoutChildren || isRoot());
295 296
296 computeOverflow(oldClientAfterEdge); 297 computeRegionRangeForBlock(flowThread);
297 298
298 statePusher.pop(); 299 computeOverflow(oldClientAfterEdge);
300 }
299 301
300 updateLayerTransform(); 302 updateLayerTransform();
301 303
302 if (view()->layoutState()->pageLogicalHeight()) 304 if (view()->layoutState()->pageLogicalHeight())
303 setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(*this, log icalTop())); 305 setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(*this, log icalTop()));
304 306
305 // Update our scrollbars if we're overflow:auto/scroll/hidden now that we kn ow if 307 // Update our scrollbars if we're overflow:auto/scroll/hidden now that we kn ow if
306 // we overflow or not. 308 // we overflow or not.
307 if (hasOverflowClip()) 309 if (hasOverflowClip())
308 layer()->scrollableArea()->updateAfterLayout(); 310 layer()->scrollableArea()->updateAfterLayout();
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 if (isPseudoElement()) 1080 if (isPseudoElement())
1079 return "RenderDeprecatedFlexibleBox (generated)"; 1081 return "RenderDeprecatedFlexibleBox (generated)";
1080 if (isAnonymous()) 1082 if (isAnonymous())
1081 return "RenderDeprecatedFlexibleBox (generated)"; 1083 return "RenderDeprecatedFlexibleBox (generated)";
1082 if (isRelPositioned()) 1084 if (isRelPositioned())
1083 return "RenderDeprecatedFlexibleBox (relative positioned)"; 1085 return "RenderDeprecatedFlexibleBox (relative positioned)";
1084 return "RenderDeprecatedFlexibleBox"; 1086 return "RenderDeprecatedFlexibleBox";
1085 } 1087 }
1086 1088
1087 } // namespace WebCore 1089 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698