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

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

Issue 18601002: Add infrastructure for partial layouts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: If text autosizing is enabled, only partial layout for the second of two layouts Created 7 years, 4 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/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index 52aca14df705f914b76c23dbc286d64ce857f688..8e6431e7d79a4c4d20a03e27a410d98d47bf10c2 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -1387,6 +1387,9 @@ void RenderBlock::layout()
// layoutBlock().
layoutBlock(false);
+ if (document()->view()->shouldStopPartialLayout())
+ return;
+
// It's safe to check for control clip here, since controls can never be table cells.
// If we have a lightweight clip, there can never be any overflow from children.
if (hasControlClip() && m_overflow)
@@ -1595,6 +1598,12 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
else
layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom);
+ // If layout was just for one of our children, stop early (before setting setNeedsLayout=false!)
+ if (document()->view()->shouldStopPartialLayout()) {
+ statePusher.pop();
+ return;
+ }
+
// Expand our intrinsic height to encompass floats.
LayoutUnit toAdd = borderAfter() + paddingAfter() + scrollbarLogicalHeight();
if (lowestFloatLogicalBottom() > (logicalHeight() - toAdd) && expandsToEncloseOverhangingFloats())
@@ -1642,6 +1651,9 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
fitBorderToLinesIfNeeded();
+ if (document()->view()->shouldStopPartialLayout())
+ return;
+
if (renderView->layoutState()->m_pageLogicalHeight)
setPageLogicalOffset(renderView->layoutState()->pageLogicalOffset(this, logicalTop()));
@@ -2514,6 +2526,10 @@ void RenderBlock::layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloa
// Lay out the child.
layoutBlockChild(child, marginInfo, previousFloatLogicalBottom, maxFloatLogicalBottom);
+
+ document()->view()->checkPartialLayoutComplete(child);
esprehn 2013/08/18 03:43:15 you should add frameView() to RenderObject if you
pdr. 2013/08/20 06:19:10 Done.
+ if (document()->view()->shouldStopPartialLayout())
+ break;
}
// Now do the handling of the bottom of the block, adding in our bottom border/padding and
@@ -2578,6 +2594,9 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, Lay
if (childNeededLayout)
child->layout();
+ if (document()->view()->shouldStopPartialLayout())
+ return;
+
// Cache if we are at the top of the block right now.
bool atBeforeSideOfBlock = marginInfo.atBeforeSideOfBlock();

Powered by Google App Engine
This is Rietveld 408576698