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

Unified Diff: Source/core/rendering/RenderDeprecatedFlexibleBox.cpp

Issue 196533012: Make LayoutState always be RAII (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: It's the ToT as you can see 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
diff --git a/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
index 0405fda927edea2b1cc314932f1286cf27e71997..f3d341eba34d84d5d0c2cb41714782ed51046579 100644
--- a/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
+++ b/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
@@ -258,46 +258,48 @@ void RenderDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren)
return;
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
- LayoutStateMaintainer statePusher(*this, locationOffset());
- RenderFlowThread* flowThread = flowThreadContainingBlock();
- if (updateRegionsAndShapesLogicalSize(flowThread))
- relayoutChildren = true;
+ {
+ // LayoutStateMaintainer needs this deliberate scope to pop before repaint
+ LayoutStateMaintainer statePusher(*this, locationOffset());
- LayoutSize previousSize = size();
+ RenderFlowThread* flowThread = flowThreadContainingBlock();
+ if (updateRegionsAndShapesLogicalSize(flowThread))
+ relayoutChildren = true;
- updateLogicalWidth();
- updateLogicalHeight();
+ LayoutSize previousSize = size();
- if (previousSize != size()
- || (parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
- && parent()->style()->boxAlign() == BSTRETCH))
- relayoutChildren = true;
+ updateLogicalWidth();
+ updateLogicalHeight();
- setHeight(0);
+ if (previousSize != size()
+ || (parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
+ && parent()->style()->boxAlign() == BSTRETCH))
+ relayoutChildren = true;
- m_stretchingChildren = false;
+ setHeight(0);
- if (isHorizontal())
- layoutHorizontalBox(relayoutChildren);
- else
- layoutVerticalBox(relayoutChildren);
+ m_stretchingChildren = false;
- LayoutUnit oldClientAfterEdge = clientLogicalBottom();
- updateLogicalHeight();
+ if (isHorizontal())
+ layoutHorizontalBox(relayoutChildren);
+ else
+ layoutVerticalBox(relayoutChildren);
- if (previousSize.height() != height())
- relayoutChildren = true;
+ LayoutUnit oldClientAfterEdge = clientLogicalBottom();
+ updateLogicalHeight();
- layoutPositionedObjects(relayoutChildren || isRoot());
+ if (previousSize.height() != height())
+ relayoutChildren = true;
- computeRegionRangeForBlock(flowThread);
+ layoutPositionedObjects(relayoutChildren || isRoot());
- computeOverflow(oldClientAfterEdge);
+ computeRegionRangeForBlock(flowThread);
- statePusher.pop();
+ computeOverflow(oldClientAfterEdge);
- updateLayerTransform();
+ updateLayerTransform();
Julien - ping for review 2014/03/13 17:44:27 Interestingly updateLayerTransform was out of the
+ }
if (view()->layoutState()->pageLogicalHeight())
setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(*this, logicalTop()));

Powered by Google App Engine
This is Rietveld 408576698