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

Unified Diff: Source/core/rendering/RenderBlockFlow.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/RenderBlock.cpp ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlockFlow.cpp
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index 17f8352da65b18997b7b5b46baf619a551bf71a1..70fde3af664a59ee531caa0d16db88527a20198c 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -301,14 +301,35 @@ void RenderBlockFlow::layoutBlock(bool relayoutChildren)
// number of columns.
bool done = false;
LayoutUnit pageLogicalHeight = 0;
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
while (!done)
done = layoutBlockFlow(relayoutChildren, pageLogicalHeight, layoutScope);
+
+ fitBorderToLinesIfNeeded();
+
+ RenderView* renderView = view();
+ if (renderView->layoutState()->m_pageLogicalHeight)
+ setPageLogicalOffset(renderView->layoutState()->pageLogicalOffset(*this, logicalTop()));
+
+ updateLayerTransform();
+
+ // Update our scroll information if we're overflow:auto/scroll/hidden now that we know if
+ // we overflow or not.
+ updateScrollInfoAfterLayout();
+
+ // Repaint with our new bounds if they are different from our old bounds.
+ bool didFullRepaint = repainter.repaintAfterLayout();
+ if (!didFullRepaint && m_repaintLogicalTop != m_repaintLogicalBottom && (style()->visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) {
+ if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+ setShouldRepaintOverflow(true);
+ else
+ repaintOverflow();
+ }
+ clearNeedsLayout();
}
inline bool RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit &pageLogicalHeight, SubtreeLayoutScope& layoutScope)
{
- LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
-
LayoutUnit oldLeft = logicalLeft();
if (updateLogicalWidthAndColumnWidth())
relayoutChildren = true;
@@ -368,7 +389,6 @@ inline bool RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit &
if (RenderMultiColumnFlowThread* flowThread = multiColumnFlowThread()) {
if (flowThread->recalculateColumnHeights()) {
setChildNeedsLayout(MarkOnlyThis);
- statePusher.pop();
return false;
}
} else if (hasColumns()) {
@@ -381,7 +401,6 @@ inline bool RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit &
m_overflow = savedOverflow.release();
if (!hasSpecifiedPageLogicalHeight && shouldRelayoutForPagination(pageLogicalHeight, layoutOverflowLogicalBottom)) {
- statePusher.pop();
setEverHadLayout(true);
return false;
}
@@ -390,7 +409,6 @@ inline bool RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit &
}
if (shouldBreakAtLineToAvoidWidow()) {
- statePusher.pop();
setEverHadLayout(true);
return false;
}
@@ -428,30 +446,6 @@ inline bool RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit &
// Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
computeOverflow(oldClientAfterEdge);
- statePusher.pop();
-
- fitBorderToLinesIfNeeded();
-
- RenderView* renderView = view();
- if (renderView->layoutState()->m_pageLogicalHeight)
- setPageLogicalOffset(renderView->layoutState()->pageLogicalOffset(*this, logicalTop()));
-
- updateLayerTransform();
-
- // Update our scroll information if we're overflow:auto/scroll/hidden now that we know if
- // we overflow or not.
- updateScrollInfoAfterLayout();
-
- // Repaint with our new bounds if they are different from our old bounds.
- bool didFullRepaint = repainter.repaintAfterLayout();
- if (!didFullRepaint && m_repaintLogicalTop != m_repaintLogicalBottom && (style()->visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) {
- if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
- setShouldRepaintOverflow(true);
- else
- repaintOverflow();
- }
-
- clearNeedsLayout();
return true;
}
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698