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

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: Address reviewer comments. Add PartialLayoutState and PartialLayoutDisabler 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 d682abab11789e1068a1b47da22ade31ee1f07cc..8f3dc44e8a883aa19093110b9751d328d0412413 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -1387,6 +1387,9 @@ void RenderBlock::layout()
// layoutBlock().
layoutBlock(false);
+ if (frameView()->partialLayout().shouldStop())
+ 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)
@@ -1597,6 +1600,11 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
else
layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom, layoutScope);
+ if (frameView()->partialLayout().shouldStop()) {
+ statePusher.pop();
+ return;
+ }
+
// Expand our intrinsic height to encompass floats.
LayoutUnit toAdd = borderAfter() + paddingAfter() + scrollbarLogicalHeight();
if (lowestFloatLogicalBottom() > (logicalHeight() - toAdd) && expandsToEncloseOverhangingFloats())
@@ -1644,6 +1652,9 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
fitBorderToLinesIfNeeded();
+ if (frameView()->partialLayout().shouldStop())
+ return;
+
if (renderView->layoutState()->m_pageLogicalHeight)
setPageLogicalOffset(renderView->layoutState()->pageLogicalOffset(this, logicalTop()));
@@ -2516,6 +2527,10 @@ void RenderBlock::layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloa
// Lay out the child.
layoutBlockChild(child, marginInfo, previousFloatLogicalBottom, maxFloatLogicalBottom);
+
+ // If doing a partial layout and the child was the target renderer, early exit here.
+ if (frameView()->partialLayout().checkPartialLayoutComplete(child))
+ break;
}
// Now do the handling of the bottom of the block, adding in our bottom border/padding and
@@ -2581,6 +2596,9 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, Lay
if (childNeededLayout)
child->layout();
+ if (frameView()->partialLayout().shouldStop())
+ 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