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

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: Updated to ToT 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
« no previous file with comments | « Source/core/rendering/RenderFlexibleBox.h ('k') | Source/core/rendering/RenderGrid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderFlexibleBox.cpp
diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp
index 696ff78943af6b463e13a24247c719476fbbc45f..84355893d12078e4e7f9cb3bc14a9a0b43b5814c 100644
--- a/Source/core/rendering/RenderFlexibleBox.cpp
+++ b/Source/core/rendering/RenderFlexibleBox.cpp
@@ -241,40 +241,37 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
LayoutUnit previousHeight = logicalHeight();
setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight());
- LayoutStateMaintainer statePusher(*this, locationOffset());
-
- RenderFlowThread* flowThread = flowThreadContainingBlock();
- if (updateRegionsAndShapesLogicalSize(flowThread))
- relayoutChildren = true;
+ {
+ LayoutStateMaintainer statePusher(*this, locationOffset());
- m_numberOfInFlowChildrenOnFirstLine = -1;
+ RenderFlowThread* flowThread = flowThreadContainingBlock();
+ if (updateRegionsAndShapesLogicalSize(flowThread))
+ relayoutChildren = true;
- RenderBlock::startDelayUpdateScrollInfo();
+ m_numberOfInFlowChildrenOnFirstLine = -1;
- prepareOrderIteratorAndMargins();
+ RenderBlock::startDelayUpdateScrollInfo();
- ChildFrameRects oldChildRects;
- appendChildFrameRects(oldChildRects);
+ prepareOrderIteratorAndMargins();
- Vector<LineContext> lineContexts;
- layoutFlexItems(relayoutChildren, lineContexts);
+ ChildFrameRects oldChildRects;
+ appendChildFrameRects(oldChildRects);
- updateLogicalHeight();
- repositionLogicalHeightDependentFlexItems(lineContexts);
+ layoutFlexItems(relayoutChildren);
- RenderBlock::finishDelayUpdateScrollInfo();
+ RenderBlock::finishDelayUpdateScrollInfo();
- if (logicalHeight() != previousHeight)
- relayoutChildren = true;
+ if (logicalHeight() != previousHeight)
+ relayoutChildren = true;
- layoutPositionedObjects(relayoutChildren || isRoot());
+ layoutPositionedObjects(relayoutChildren || isRoot());
- computeRegionRangeForBlock(flowThread);
+ computeRegionRangeForBlock(flowThread);
- repaintChildrenDuringLayoutIfMoved(oldChildRects);
- // FIXME: css3/flexbox/repaint-rtl-column.html seems to repaint more overflow than it needs to.
- computeOverflow(clientLogicalBottomAfterRepositioning());
- statePusher.pop();
+ repaintChildrenDuringLayoutIfMoved(oldChildRects);
+ // FIXME: css3/flexbox/repaint-rtl-column.html seems to repaint more overflow than it needs to.
+ computeOverflow(clientLogicalBottomAfterRepositioning());
+ }
updateLayerTransform();
@@ -670,8 +667,9 @@ 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)
{
+ Vector<LineContext> lineContexts;
OrderedFlexItemList orderedChildren;
LayoutUnit sumFlexBaseSize;
double totalFlexGrow;
@@ -707,6 +705,9 @@ void RenderFlexibleBox::layoutFlexItems(bool relayoutChildren, Vector<LineContex
if (height() < minHeight)
setLogicalHeight(minHeight);
}
+
+ updateLogicalHeight();
+ repositionLogicalHeightDependentFlexItems(lineContexts);
}
LayoutUnit RenderFlexibleBox::autoMarginOffsetInMainAxis(const OrderedFlexItemList& children, LayoutUnit& availableFreeSpace)
« no previous file with comments | « Source/core/rendering/RenderFlexibleBox.h ('k') | Source/core/rendering/RenderGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698