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

Unified Diff: Source/core/rendering/RenderFlexibleBox.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/RenderFlexibleBox.cpp
diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp
index 696ff78943af6b463e13a24247c719476fbbc45f..686366aca2b905ea2c6e1ce314dbc963456655b6 100644
--- a/Source/core/rendering/RenderFlexibleBox.cpp
+++ b/Source/core/rendering/RenderFlexibleBox.cpp
@@ -241,8 +241,6 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
LayoutUnit previousHeight = logicalHeight();
setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight());
- LayoutStateMaintainer statePusher(*this, locationOffset());
-
RenderFlowThread* flowThread = flowThreadContainingBlock();
if (updateRegionsAndShapesLogicalSize(flowThread))
relayoutChildren = true;
@@ -256,11 +254,7 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
ChildFrameRects oldChildRects;
appendChildFrameRects(oldChildRects);
- Vector<LineContext> lineContexts;
- layoutFlexItems(relayoutChildren, lineContexts);
-
- updateLogicalHeight();
- repositionLogicalHeightDependentFlexItems(lineContexts);
+ layoutFlexItems(relayoutChildren);
RenderBlock::finishDelayUpdateScrollInfo();
@@ -274,7 +268,6 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
repaintChildrenDuringLayoutIfMoved(oldChildRects);
// FIXME: css3/flexbox/repaint-rtl-column.html seems to repaint more overflow than it needs to.
computeOverflow(clientLogicalBottomAfterRepositioning());
- statePusher.pop();
updateLayerTransform();
@@ -670,8 +663,10 @@ LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox*
return std::max(LayoutUnit(0), computeMainAxisExtentForChild(child, MainOrPreferredSize, flexBasis));
}
-void RenderFlexibleBox::layoutFlexItems(bool relayoutChildren, Vector<LineContext>& lineContexts)
+void RenderFlexibleBox::layoutFlexItems(bool relayoutChildren)
{
+ LayoutStateMaintainer statePusher(*this, locationOffset());
+ Vector<LineContext> lineContexts;
OrderedFlexItemList orderedChildren;
LayoutUnit sumFlexBaseSize;
double totalFlexGrow;
@@ -707,6 +702,9 @@ void RenderFlexibleBox::layoutFlexItems(bool relayoutChildren, Vector<LineContex
if (height() < minHeight)
setLogicalHeight(minHeight);
}
+
+ updateLogicalHeight();
+ repositionLogicalHeightDependentFlexItems(lineContexts);
}
LayoutUnit RenderFlexibleBox::autoMarginOffsetInMainAxis(const OrderedFlexItemList& children, LayoutUnit& availableFreeSpace)

Powered by Google App Engine
This is Rietveld 408576698