Changeset 150478 in webkit


Ignore:
Timestamp:
May 21, 2013 2:04:27 PM (11 years ago)
Author:
zoltan@webkit.org
Message:

[CSS Regions][CSS Exclusions] Multiple regions with shape-insides should respect positioned shapes and overflow
https://bugs.webkit.org/show_bug.cgi?id=115001

Reviewed by David Hyatt.

In r150375 I implemented the new overflow behavior for shape-inside on regions, but it covered only the simple cases
when you had only one region. This patch adds support for the new overflow behavior for multiple regions with multiple
positioned shape-insides and overflow.

Source/WebCore:

Tests: fast/regions/shape-inside/shape-inside-on-regions-block-content-overflow-multiple-shapes.html

fast/regions/shape-inside/shape-inside-on-regions-inline-content-overflow-multiple-shapes.html

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::updateLineBoundariesForExclusions): Cover cases when content flows into the next region, update the
line segments for the overflow.
(WebCore::RenderBlock::adjustLogicalLineTopAndLogicalHeightIfNeeded): In flow thread case we don't want to adjust the height
in two places.

LayoutTests:

  • fast/regions/shape-inside/shape-inside-on-regions-block-content-overflow-multiple-shapes-expected.html: Added.
  • fast/regions/shape-inside/shape-inside-on-regions-block-content-overflow-multiple-shapes.html: Added.
  • fast/regions/shape-inside/shape-inside-on-regions-inline-content-overflow-multiple-shapes-expected.html: Added.
  • fast/regions/shape-inside/shape-inside-on-regions-inline-content-overflow-multiple-shapes.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r150477 r150478  
     12013-05-21  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS Regions][CSS Exclusions] Multiple regions with shape-insides should respect positioned shapes and overflow
     4        https://bugs.webkit.org/show_bug.cgi?id=115001
     5
     6        Reviewed by David Hyatt.
     7
     8        In r150375 I implemented the new overflow behavior for shape-inside on regions, but it covered only the simple cases
     9        when you had only one region. This patch adds support for the new overflow behavior for multiple regions with multiple
     10        positioned shape-insides and overflow.
     11
     12        * fast/regions/shape-inside/shape-inside-on-regions-block-content-overflow-multiple-shapes-expected.html: Added.
     13        * fast/regions/shape-inside/shape-inside-on-regions-block-content-overflow-multiple-shapes.html: Added.
     14        * fast/regions/shape-inside/shape-inside-on-regions-inline-content-overflow-multiple-shapes-expected.html: Added.
     15        * fast/regions/shape-inside/shape-inside-on-regions-inline-content-overflow-multiple-shapes.html: Added.
     16
    1172013-05-21  Brent Fulgham  <bfulgham@apple.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r150475 r150478  
     12013-05-21  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS Regions][CSS Exclusions] Multiple regions with shape-insides should respect positioned shapes and overflow
     4        https://bugs.webkit.org/show_bug.cgi?id=115001
     5
     6        Reviewed by David Hyatt.
     7
     8        In r150375 I implemented the new overflow behavior for shape-inside on regions, but it covered only the simple cases
     9        when you had only one region. This patch adds support for the new overflow behavior for multiple regions with multiple
     10        positioned shape-insides and overflow.
     11
     12        Tests: fast/regions/shape-inside/shape-inside-on-regions-block-content-overflow-multiple-shapes.html
     13               fast/regions/shape-inside/shape-inside-on-regions-inline-content-overflow-multiple-shapes.html
     14
     15        * rendering/RenderBlockLineLayout.cpp:
     16        (WebCore::RenderBlock::updateLineBoundariesForExclusions): Cover cases when content flows into the next region, update the
     17        line segments for the overflow.
     18        (WebCore::RenderBlock::adjustLogicalLineTopAndLogicalHeightIfNeeded): In flow thread case we don't want to adjust the height
     19        in two places.
     20
    1212013-05-21  Commit Queue  <commit-queue@webkit.org>
    222
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r150375 r150478  
    16741674    LayoutUnit shapeContainingBlockHeight = exclusionShapeInsideInfo->shapeContainingBlockHeight();
    16751675    if (!exclusionShapeInsideInfo->lineWithinShapeBounds() && !lineOverflowsFromShapeInside && shapeContainingBlockHeight) {
    1676         LayoutUnit newHeight = shapeContainingBlockHeight;
     1676        lineOverflowsFromShapeInside = true;
     1677        LayoutUnit newLogicalHeight = shapeContainingBlockHeight;
    16771678
    16781679        if (layoutState.flowThread()) {
     
    16801681            if (lineTop < 0)
    16811682                return;
    1682             newHeight = logicalHeight + shapeContainingBlockHeight - lineTop - currentRegion->borderAndPaddingBefore();
    1683         }
    1684         setLogicalHeight(newHeight);
    1685         lineOverflowsFromShapeInside = true;
     1683
     1684            newLogicalHeight = logicalHeight + shapeContainingBlockHeight - lineTop - currentRegion->borderAndPaddingBefore();
     1685
     1686            RenderRegion* nextRegion = regionAtBlockOffset(newLogicalHeight);
     1687            ExclusionShapeInsideInfo* nextShapeInfo = 0;
     1688            if (nextRegion)
     1689                nextShapeInfo = nextRegion->exclusionShapeInsideInfo();
     1690
     1691            // The overflow flows into another region with shape-inside
     1692            if (currentRegion != nextRegion && nextShapeInfo) {
     1693                newLogicalHeight += nextShapeInfo->shapeLogicalTop() - nextRegion->borderAndPaddingBefore();
     1694
     1695                LayoutUnit offset = nextShapeInfo->shapeLogicalTop() - nextRegion->borderAndPaddingBefore();
     1696                nextShapeInfo->computeSegmentsForLine(offset, lineHeight);
     1697
     1698                exclusionShapeInsideInfo = nextShapeInfo;
     1699                lineOverflowsFromShapeInside = false;
     1700            }
     1701        }
     1702        setLogicalHeight(newLogicalHeight);
    16861703    }
    16871704}
     
    16941711
    16951712    LayoutUnit newLogicalHeight = adjustedLogicalLineTop - absoluteLogicalTop;
    1696     RenderRegion* currentRegion = regionAtBlockOffset(logicalHeight());
    16971713    if (layoutState.flowThread())
    1698         newLogicalHeight -= currentRegion->logicalTopForFlowThreadContent();
     1714        newLogicalHeight = logicalHeight();
    16991715
    17001716    end = restartLayoutRunsAndFloatsInRange(logicalHeight(), newLogicalHeight, lastFloatFromPreviousLine, resolver, end);
Note: See TracChangeset for help on using the changeset viewer.