Changeset 151703 in webkit


Ignore:
Timestamp:
Jun 18, 2013 3:31:57 PM (11 years ago)
Author:
zoltan@webkit.org
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.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r151702 r151703  
     12013-06-18  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS Shapes] Remove lineOverflowsFromShapeInside boolean from RenderBlock::layoutRunsAndFloatsInRange function
     4        https://bugs.webkit.org/show_bug.cgi?id=117757
     5
     6        Reviewed by David Hyatt.
     7
     8        We don't need keep lineOverflowsFromShapeInside boolean in RenderBlock::layoutRunsAndFloatsInRange and in its
     9        helpers because it's easy to decide whether we are in an shape content overflow state or not, so I got rid of
     10        lineOverflowsFromShapeInside's occurences and updated the affected functions.
     11
     12        Covered by existing overflow tests in fast/exclusions/shape-inside and fast/regions/shape-inside.
     13
     14        * rendering/RenderBlock.h: Update helper's definition.
     15        * rendering/RenderBlockLineLayout.cpp:
     16        (WebCore::pushShapeContentOverflowBelowTheContentBox): Add condition when overflow is already positioned.
     17        (WebCore::RenderBlock::updateShapeAndSegmentsForCurrentLine): Remove lineOverflowsFromShapeInside.
     18        (WebCore::RenderBlock::updateShapeAndSegmentsForCurrentLineInFlowThread):  Remove lineOverflowsFromShapeInside.
     19        (WebCore::RenderBlock::layoutRunsAndFloatsInRange):  Remove lineOverflowsFromShapeInside.
     20
    1212013-06-18  Zalan Bujtas  <zalan@apple.com>
    222
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r151570 r151703  
    10861086    void layoutRunsAndFloatsInRange(LineLayoutState&, InlineBidiResolver&, const InlineIterator& cleanLineStart, const BidiStatus& cleanLineBidiStatus, unsigned consecutiveHyphenatedLines);
    10871087#if ENABLE(CSS_SHAPES)
    1088     void updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*&, LayoutUnit&, LineLayoutState&, bool&);
    1089     void updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideInfo*&, LineLayoutState&, bool&);
     1088    void updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*&, LayoutUnit&, LineLayoutState&);
     1089    void updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideInfo*&, LineLayoutState&);
    10901090    bool adjustLogicalLineTopAndLogicalHeightIfNeeded(ShapeInsideInfo*, LayoutUnit, LineLayoutState&, InlineBidiResolver&, FloatingObject*, InlineIterator&, WordMeasurements&);
    10911091#endif
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r151652 r151703  
    16531653}
    16541654
    1655 static inline void pushShapeContentOverflowBelowTheContentBox(RenderBlock* block, ShapeInsideInfo* shapeInsideInfo, LayoutUnit lineTop, LayoutUnit lineHeight, bool& lineOverflowsFromShapeInside)
    1656 {
    1657     if (lineOverflowsFromShapeInside)
    1658         return;
     1655static inline void pushShapeContentOverflowBelowTheContentBox(RenderBlock* block, ShapeInsideInfo* shapeInsideInfo, LayoutUnit lineTop, LayoutUnit lineHeight)
     1656{
     1657    ASSERT(shapeInsideInfo);
    16591658
    16601659    LayoutUnit logicalLineBottom = lineTop + lineHeight;
    16611660    LayoutUnit shapeContainingBlockHeight = shapeInsideInfo->shapeContainingBlockHeight();
    1662     if (logicalLineBottom <= shapeInsideInfo->shapeLogicalBottom() || !shapeContainingBlockHeight)
     1661
     1662    bool isOverflowPositionedAlready = (shapeContainingBlockHeight - shapeInsideInfo->owner()->borderAndPaddingAfter() + lineHeight) <= lineTop;
     1663
     1664    if (logicalLineBottom <= shapeInsideInfo->shapeLogicalBottom() || !shapeContainingBlockHeight || isOverflowPositionedAlready)
    16631665        return;
    16641666
    16651667    LayoutUnit newLogicalHeight = block->logicalHeight() + (shapeContainingBlockHeight - (lineTop + shapeInsideInfo->owner()->borderAndPaddingAfter()));
    16661668    block->setLogicalHeight(newLogicalHeight);
    1667 
    1668     lineOverflowsFromShapeInside = true;
    1669 }
    1670 
    1671 void RenderBlock::updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*& shapeInsideInfo, LayoutUnit& absoluteLogicalTop, LineLayoutState& layoutState, bool& lineOverflowsFromShapeInside)
     1669}
     1670
     1671void RenderBlock::updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*& shapeInsideInfo, LayoutUnit& absoluteLogicalTop, LineLayoutState& layoutState)
    16721672{
    16731673    if (layoutState.flowThread())
    1674         return updateShapeAndSegmentsForCurrentLineInFlowThread(shapeInsideInfo, layoutState, lineOverflowsFromShapeInside);
    1675 
    1676     if (!shapeInsideInfo || lineOverflowsFromShapeInside)
     1674        return updateShapeAndSegmentsForCurrentLineInFlowThread(shapeInsideInfo, layoutState);
     1675
     1676    if (!shapeInsideInfo)
    16771677        return;
    16781678
     
    16831683    shapeInsideInfo->computeSegmentsForLine(lineTop, lineHeight);
    16841684
    1685     pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight, lineOverflowsFromShapeInside);
    1686 }
    1687 
    1688 void RenderBlock::updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideInfo*& shapeInsideInfo, LineLayoutState& layoutState, bool& lineOverflowsFromShapeInside)
     1685    pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight);
     1686}
     1687
     1688void RenderBlock::updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideInfo*& shapeInsideInfo, LineLayoutState& layoutState)
    16891689{
    16901690    ASSERT(layoutState.flowThread());
     
    17271727
    17281728        currentRegion = nextRegion;
    1729         lineOverflowsFromShapeInside = false;
    17301729
    17311730        logicalLineTopInFlowThread = logicalHeight() + offsetFromLogicalTopOfFirstPage();
     
    17561755
    17571756    if (currentRegion->isLastRegion())
    1758         pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight, lineOverflowsFromShapeInside);
     1757        pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight);
    17591758}
    17601759
     
    18081807        }
    18091808    }
    1810 
    1811     bool lineOverflowsFromShapeInside = false;
    18121809#endif
    18131810
     
    18321829
    18331830#if ENABLE(CSS_SHAPES)
    1834         updateShapeAndSegmentsForCurrentLine(shapeInsideInfo, absoluteLogicalTop, layoutState, lineOverflowsFromShapeInside);
     1831        updateShapeAndSegmentsForCurrentLine(shapeInsideInfo, absoluteLogicalTop, layoutState);
    18351832#endif
    18361833        WordMeasurements wordMeasurements;
Note: See TracChangeset for help on using the changeset viewer.