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

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: Fix release compile, minor cleanups 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 e94a24f4835ad985a2aaff8f568278b3aa37d3b6..64ab691ccca9e24690fb0e896f5c992c8bec1561 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -1412,6 +1412,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)
@@ -1620,6 +1623,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())
@@ -1667,6 +1676,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()));
@@ -2539,6 +2551,10 @@ void RenderBlock::layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloa
// Lay out the child.
layoutBlockChild(child, marginInfo, previousFloatLogicalBottom, maxFloatLogicalBottom);
+
+ document()->view()->checkPartialLayoutComplete(child);
+ if (document()->view()->shouldStopPartialLayout())
+ break;
}
// Now do the handling of the bottom of the block, adding in our bottom border/padding and
@@ -2603,6 +2619,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