Index: Source/WebCore/rendering/RenderBlock.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderBlock.cpp (revision 107302) |
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy) |
@@ -1207,6 +1207,27 @@ |
clearLayoutOverflow(); |
} |
+void RenderBlock::computeInitialRegionRangeForBlock() |
+{ |
+ if (inRenderFlowThread()) { |
+ // Set our start and end regions. No regions above or below us will be considered by our children. They are |
+ // effectively clamped to our region range. |
+ LayoutUnit oldHeight = logicalHeight(); |
+ LayoutUnit oldLogicalTop = logicalTop(); |
+ setLogicalHeight(numeric_limits<LayoutUnit>::max() / 2); |
+ computeLogicalHeight(); |
+ enclosingRenderFlowThread()->setRegionRangeForBox(this, offsetFromLogicalTopOfFirstPage()); |
+ setLogicalHeight(oldHeight); |
+ setLogicalTop(oldLogicalTop); |
+ } |
+} |
+ |
+void RenderBlock::computeRegionRangeForBlock() |
+{ |
+ if (inRenderFlowThread()) |
+ enclosingRenderFlowThread()->setRegionRangeForBox(this, offsetFromLogicalTopOfFirstPage()); |
+} |
+ |
void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight, BlockLayoutPass layoutPass) |
{ |
ASSERT(needsLayout()); |
@@ -1266,22 +1287,13 @@ |
RenderView* renderView = view(); |
RenderStyle* styleToUse = style(); |
LayoutStateMaintainer statePusher(renderView, this, locationOffset(), hasColumns() || hasTransform() || hasReflection() || styleToUse->isFlippedBlocksWritingMode(), pageLogicalHeight, pageLogicalHeightChanged, colInfo); |
- |
+ |
if (inRenderFlowThread()) { |
// Regions changing widths can force us to relayout our children. |
if (logicalWidthChangedInRegions()) |
relayoutChildren = true; |
- |
- // Set our start and end regions. No regions above or below us will be considered by our children. They are |
- // effectively clamped to our region range. |
- LayoutUnit oldHeight = logicalHeight(); |
- LayoutUnit oldLogicalTop = logicalTop(); |
- setLogicalHeight(numeric_limits<LayoutUnit>::max() / 2); |
- computeLogicalHeight(); |
- enclosingRenderFlowThread()->setRegionRangeForBox(this, offsetFromLogicalTopOfFirstPage()); |
- setLogicalHeight(oldHeight); |
- setLogicalTop(oldLogicalTop); |
} |
+ computeInitialRegionRangeForBlock(); |
// We use four values, maxTopPos, maxTopNeg, maxBottomPos, and maxBottomNeg, to track |
// our current maximal positive and negative margins. These values are used when we |
@@ -1359,8 +1371,7 @@ |
bool needAnotherLayoutPass = layoutPositionedObjects(relayoutChildren || isRoot()); |
- if (inRenderFlowThread()) |
- enclosingRenderFlowThread()->setRegionRangeForBox(this, offsetFromLogicalTopOfFirstPage()); |
+ computeRegionRangeForBlock(); |
// Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway). |
computeOverflow(oldClientAfterEdge); |