Title: [151703] trunk/Source/WebCore
Revision
151703
Author
[email protected]
Date
2013-06-18 15:31:57 -0700 (Tue, 18 Jun 2013)

Log Message

[CSS Shapes] Remove lineOverflowsFromShapeInside boolean from RenderBlock::layoutRunsAndFloatsInRange function
https://bugs.webkit.org/show_bug.cgi?id=117757

Reviewed by David Hyatt.

We don't need keep lineOverflowsFromShapeInside boolean in RenderBlock::layoutRunsAndFloatsInRange and in its
helpers because it's easy to decide whether we are in an shape content overflow state or not, so I got rid of
lineOverflowsFromShapeInside's occurences and updated the affected functions.

Covered by existing overflow tests in fast/exclusions/shape-inside and fast/regions/shape-inside.

* rendering/RenderBlock.h: Update helper's definition.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::pushShapeContentOverflowBelowTheContentBox): Add condition when overflow is already positioned.
(WebCore::RenderBlock::updateShapeAndSegmentsForCurrentLine): Remove lineOverflowsFromShapeInside.
(WebCore::RenderBlock::updateShapeAndSegmentsForCurrentLineInFlowThread):  Remove lineOverflowsFromShapeInside.
(WebCore::RenderBlock::layoutRunsAndFloatsInRange):  Remove lineOverflowsFromShapeInside.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (151702 => 151703)


--- trunk/Source/WebCore/ChangeLog	2013-06-18 22:03:07 UTC (rev 151702)
+++ trunk/Source/WebCore/ChangeLog	2013-06-18 22:31:57 UTC (rev 151703)
@@ -1,3 +1,23 @@
+2013-06-18  Zoltan Horvath  <[email protected]>
+
+        [CSS Shapes] Remove lineOverflowsFromShapeInside boolean from RenderBlock::layoutRunsAndFloatsInRange function
+        https://bugs.webkit.org/show_bug.cgi?id=117757
+
+        Reviewed by David Hyatt.
+
+        We don't need keep lineOverflowsFromShapeInside boolean in RenderBlock::layoutRunsAndFloatsInRange and in its
+        helpers because it's easy to decide whether we are in an shape content overflow state or not, so I got rid of
+        lineOverflowsFromShapeInside's occurences and updated the affected functions.
+
+        Covered by existing overflow tests in fast/exclusions/shape-inside and fast/regions/shape-inside.
+
+        * rendering/RenderBlock.h: Update helper's definition.
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::pushShapeContentOverflowBelowTheContentBox): Add condition when overflow is already positioned.
+        (WebCore::RenderBlock::updateShapeAndSegmentsForCurrentLine): Remove lineOverflowsFromShapeInside.
+        (WebCore::RenderBlock::updateShapeAndSegmentsForCurrentLineInFlowThread):  Remove lineOverflowsFromShapeInside.
+        (WebCore::RenderBlock::layoutRunsAndFloatsInRange):  Remove lineOverflowsFromShapeInside.
+
 2013-06-18  Zalan Bujtas  <[email protected]>
 
         widthMediaFeatureEval ends up with null FrameView during iframe unload.

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);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to