⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 150375 in webkit


Ignore:
Timestamp:
May 20, 2013, 12:00:22 PM (13 years ago)
Author:
zoltan@webkit.org
Message:

[CSS Regions][CSS Exclusions] shape-inside on regions should respect positioned shapes and overflow
https://bugs.webkit.org/show_bug.cgi?id=116252

Reviewed by David Hyatt.

Regions should respect shape-inside properties which have specified top offset. Since the content which overflows from the
shape should be pushed after the content box (for details check out r148975), I implemented overflowthe behavior for simple
cases when you have only one region. I'm going to implement it for additional regions in a follow up patch.

Tests: fast/regions/shape-inside/shape-inside-on-regions-block-content-basic-overflow-shape-top-offset.html

fast/regions/shape-inside/shape-inside-on-regions-inline-content-basic-overflow-shape-top-offset.html

Source/WebCore:

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::updateLineBoundariesForExclusions): Handle the flow thread case, push the overflowing content after the
content box. Respect existing shape-inside on region tests.
(WebCore::RenderBlock::layoutRunsAndFloatsInRange): Set the correct logical top position for the shape-inside in
the case of regions. Respect the region's margins and paddings.

LayoutTests:

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r150374 r150375  
     12013-05-20  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS Regions][CSS Exclusions] shape-inside on regions should respect positioned shapes and overflow
     4        https://bugs.webkit.org/show_bug.cgi?id=116252
     5
     6        Reviewed by David Hyatt.
     7
     8        Regions should respect shape-inside properties which have specified top offset. Since the content which overflows from the
     9        shape should be pushed after the content box (for details check out r148975), I implemented  overflowthe behavior for simple
     10        cases when you have only one region. I'm going to implement it for additional regions in a follow up patch.
     11
     12        Tests: fast/regions/shape-inside/shape-inside-on-regions-block-content-basic-overflow-shape-top-offset.html
     13               fast/regions/shape-inside/shape-inside-on-regions-inline-content-basic-overflow-shape-top-offset.html
     14
     15        * fast/regions/shape-inside/shape-inside-on-regions-block-content-basic-overflow-shape-top-offset-expected.html: Added.
     16        * fast/regions/shape-inside/shape-inside-on-regions-block-content-basic-overflow-shape-top-offset.html: Added.
     17        * fast/regions/shape-inside/shape-inside-on-regions-inline-content-basic-overflow-shape-top-offset-expected.html: Added.
     18        * fast/regions/shape-inside/shape-inside-on-regions-inline-content-basic-overflow-shape-top-offset.html: Added.
     19
    1202013-05-20  Seokju Kwon  <seokju.kwon@gmail.com>
    221
  • trunk/Source/WebCore/ChangeLog

    r150373 r150375  
     12013-05-20  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS Regions][CSS Exclusions] shape-inside on regions should respect positioned shapes and overflow
     4        https://bugs.webkit.org/show_bug.cgi?id=116252
     5
     6        Reviewed by David Hyatt.
     7
     8        Regions should respect shape-inside properties which have specified top offset. Since the content which overflows from the
     9        shape should be pushed after the content box (for details check out r148975), I implemented  overflowthe behavior for simple
     10        cases when you have only one region. I'm going to implement it for additional regions in a follow up patch.
     11
     12        Tests: fast/regions/shape-inside/shape-inside-on-regions-block-content-basic-overflow-shape-top-offset.html
     13               fast/regions/shape-inside/shape-inside-on-regions-inline-content-basic-overflow-shape-top-offset.html
     14
     15        * rendering/RenderBlockLineLayout.cpp:
     16        (WebCore::RenderBlock::updateLineBoundariesForExclusions): Handle the flow thread case, push the overflowing content after the
     17        content box. Respect existing shape-inside on region tests.
     18        (WebCore::RenderBlock::layoutRunsAndFloatsInRange): Set the correct logical top position for the shape-inside in
     19        the case of regions. Respect the region's margins and paddings.
     20
    1212013-05-20  Darin Adler  <darin@apple.com>
    222
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r150027 r150375  
    16731673    // The overflow should be pushed below the content box
    16741674    LayoutUnit shapeContainingBlockHeight = exclusionShapeInsideInfo->shapeContainingBlockHeight();
    1675     if (!flowThreadContainingBlock() && !exclusionShapeInsideInfo->lineWithinShapeBounds() && !lineOverflowsFromShapeInside && shapeContainingBlockHeight) {
    1676         setLogicalHeight(shapeContainingBlockHeight);
     1675    if (!exclusionShapeInsideInfo->lineWithinShapeBounds() && !lineOverflowsFromShapeInside && shapeContainingBlockHeight) {
     1676        LayoutUnit newHeight = shapeContainingBlockHeight;
     1677
     1678        if (layoutState.flowThread()) {
     1679            // If block contents flown across multiple regions and the shape-inside was applied on the second region we can end up with negative lineTop
     1680            if (lineTop < 0)
     1681                return;
     1682            newHeight = logicalHeight + shapeContainingBlockHeight - lineTop - currentRegion->borderAndPaddingBefore();
     1683        }
     1684        setLogicalHeight(newHeight);
    16771685        lineOverflowsFromShapeInside = true;
    16781686    }
     
    17181726        }
    17191727        // Begin layout at the logical top of our shape inside.
    1720         if (logicalHeight() + absoluteLogicalTop < exclusionShapeInsideInfo->shapeLogicalTop() && !layoutState.flowThread())
    1721             setLogicalHeight(exclusionShapeInsideInfo->shapeLogicalTop() - absoluteLogicalTop);
     1728        if (logicalHeight() + absoluteLogicalTop < exclusionShapeInsideInfo->shapeLogicalTop()) {
     1729            LayoutUnit logicalHeight = exclusionShapeInsideInfo->shapeLogicalTop() - absoluteLogicalTop;
     1730            if (layoutState.flowThread())
     1731                logicalHeight -= exclusionShapeInsideInfo->owner()->borderAndPaddingBefore();
     1732            setLogicalHeight(logicalHeight);
     1733        }
    17221734    }
    17231735
Note: See TracChangeset for help on using the changeset viewer.