Modified: trunk/Source/WebCore/rendering/RenderBlock.h (151702 => 151703)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2013-06-18 22:03:07 UTC (rev 151702)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2013-06-18 22:31:57 UTC (rev 151703)
@@ -1085,8 +1085,8 @@
void layoutRunsAndFloats(LineLayoutState&, bool hasInlineChild);
void layoutRunsAndFloatsInRange(LineLayoutState&, InlineBidiResolver&, const InlineIterator& cleanLineStart, const BidiStatus& cleanLineBidiStatus, unsigned consecutiveHyphenatedLines);
#if ENABLE(CSS_SHAPES)
- void updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*&, LayoutUnit&, LineLayoutState&, bool&);
- void updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideInfo*&, LineLayoutState&, bool&);
+ void updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*&, LayoutUnit&, LineLayoutState&);
+ void updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideInfo*&, LineLayoutState&);
bool adjustLogicalLineTopAndLogicalHeightIfNeeded(ShapeInsideInfo*, LayoutUnit, LineLayoutState&, InlineBidiResolver&, FloatingObject*, InlineIterator&, WordMeasurements&);
#endif
const InlineIterator& restartLayoutRunsAndFloatsInRange(LayoutUnit oldLogicalHeight, LayoutUnit newLogicalHeight, FloatingObject* lastFloatFromPreviousLine, InlineBidiResolver&, const InlineIterator&);
Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (151702 => 151703)
--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2013-06-18 22:03:07 UTC (rev 151702)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2013-06-18 22:31:57 UTC (rev 151703)
@@ -1652,28 +1652,28 @@
return shapeInsideInfo->shapeLogicalBottom();
}
-static inline void pushShapeContentOverflowBelowTheContentBox(RenderBlock* block, ShapeInsideInfo* shapeInsideInfo, LayoutUnit lineTop, LayoutUnit lineHeight, bool& lineOverflowsFromShapeInside)
+static inline void pushShapeContentOverflowBelowTheContentBox(RenderBlock* block, ShapeInsideInfo* shapeInsideInfo, LayoutUnit lineTop, LayoutUnit lineHeight)
{
- if (lineOverflowsFromShapeInside)
- return;
+ ASSERT(shapeInsideInfo);
LayoutUnit logicalLineBottom = lineTop + lineHeight;
LayoutUnit shapeContainingBlockHeight = shapeInsideInfo->shapeContainingBlockHeight();
- if (logicalLineBottom <= shapeInsideInfo->shapeLogicalBottom() || !shapeContainingBlockHeight)
+
+ bool isOverflowPositionedAlready = (shapeContainingBlockHeight - shapeInsideInfo->owner()->borderAndPaddingAfter() + lineHeight) <= lineTop;
+
+ if (logicalLineBottom <= shapeInsideInfo->shapeLogicalBottom() || !shapeContainingBlockHeight || isOverflowPositionedAlready)
return;
LayoutUnit newLogicalHeight = block->logicalHeight() + (shapeContainingBlockHeight - (lineTop + shapeInsideInfo->owner()->borderAndPaddingAfter()));
block->setLogicalHeight(newLogicalHeight);
-
- lineOverflowsFromShapeInside = true;
}
-void RenderBlock::updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*& shapeInsideInfo, LayoutUnit& absoluteLogicalTop, LineLayoutState& layoutState, bool& lineOverflowsFromShapeInside)
+void RenderBlock::updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*& shapeInsideInfo, LayoutUnit& absoluteLogicalTop, LineLayoutState& layoutState)
{
if (layoutState.flowThread())
- return updateShapeAndSegmentsForCurrentLineInFlowThread(shapeInsideInfo, layoutState, lineOverflowsFromShapeInside);
+ return updateShapeAndSegmentsForCurrentLineInFlowThread(shapeInsideInfo, layoutState);
- if (!shapeInsideInfo || lineOverflowsFromShapeInside)
+ if (!shapeInsideInfo)
return;
LayoutUnit lineTop = logicalHeight() + absoluteLogicalTop;
@@ -1682,10 +1682,10 @@
// FIXME: Bug 95361: It is possible for a line to grow beyond lineHeight, in which case these segments may be incorrect.
shapeInsideInfo->computeSegmentsForLine(lineTop, lineHeight);
- pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight, lineOverflowsFromShapeInside);
+ pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight);
}
-void RenderBlock::updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideInfo*& shapeInsideInfo, LineLayoutState& layoutState, bool& lineOverflowsFromShapeInside)
+void RenderBlock::updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideInfo*& shapeInsideInfo, LineLayoutState& layoutState)
{
ASSERT(layoutState.flowThread());
@@ -1726,7 +1726,6 @@
setLogicalHeight(logicalHeight() + deltaToNextRegion);
currentRegion = nextRegion;
- lineOverflowsFromShapeInside = false;
logicalLineTopInFlowThread = logicalHeight() + offsetFromLogicalTopOfFirstPage();
logicalLineBottomInFlowThread = logicalLineTopInFlowThread + lineHeight;
@@ -1755,7 +1754,7 @@
shapeInsideInfo->computeSegmentsForLine(lineTop, lineHeight);
if (currentRegion->isLastRegion())
- pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight, lineOverflowsFromShapeInside);
+ pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight);
}
bool RenderBlock::adjustLogicalLineTopAndLogicalHeightIfNeeded(ShapeInsideInfo* shapeInsideInfo, LayoutUnit absoluteLogicalTop, LineLayoutState& layoutState, InlineBidiResolver& resolver, FloatingObject* lastFloatFromPreviousLine, InlineIterator& end, WordMeasurements& wordMeasurements)
@@ -1807,8 +1806,6 @@
setLogicalHeight(logicalHeight);
}
}
-
- bool lineOverflowsFromShapeInside = false;
#endif
while (!end.atEnd()) {
@@ -1831,7 +1828,7 @@
FloatingObject* lastFloatFromPreviousLine = (containsFloats()) ? m_floatingObjects->set().last() : 0;
#if ENABLE(CSS_SHAPES)
- updateShapeAndSegmentsForCurrentLine(shapeInsideInfo, absoluteLogicalTop, layoutState, lineOverflowsFromShapeInside);
+ updateShapeAndSegmentsForCurrentLine(shapeInsideInfo, absoluteLogicalTop, layoutState);
#endif
WordMeasurements wordMeasurements;
end = lineBreaker.nextLineBreak(resolver, layoutState.lineInfo(), renderTextInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines, wordMeasurements);