Changeset 143225 in webkit


Ignore:
Timestamp:
Feb 18, 2013 8:48:39 AM (11 years ago)
Author:
betravis@adobe.com
Message:

[CSS Exclusions] Support outside-shape layout for shape-inside property
https://bugs.webkit.org/show_bug.cgi?id=102571

Reviewed by David Hyatt.

Source/WebCore:

A shape-inside value of 'outside-shape' should resolve to the value of
the shape-outside property for layout. This patch introduces a helper
method to resolve shape-inside in RenderStyle, and replaces calls to
RenderStyle::shapeInside() when the resolved (layout) value should be
used.

Test: fast/exclusions/shape-inside/shape-inside-outside-shape.html

  • rendering/ExclusionShapeInfo.cpp:

(WebCore::::computedShape): Use the resolved shape-inside getter.

  • rendering/ExclusionShapeInsideInfo.h:

(WebCore::ExclusionShapeInsideInfo::isEnabledFor): Ditto.
(WebCore::ExclusionShapeInsideInfo::ExclusionShapeInsideInfo): Ditto.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::styleDidChange): Ditto.
(WebCore::RenderBlock::exclusionShapeInsideInfo): Ditto.

  • rendering/style/RenderStyle.h: Add the resolved shape inside getter.

LayoutTests:

Test that the shape-outside value correctly propagates to shape-inside
when shape-inside has a value of 'outside-shape,' using both an
undefined and a simple shape outside value.

  • fast/exclusions/shape-inside/shape-inside-outside-shape-expected.html: Added.
  • fast/exclusions/shape-inside/shape-inside-outside-shape.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143222 r143225  
     12013-02-18  Bear Travis  <betravis@adobe.com>
     2
     3        [CSS Exclusions] Support outside-shape layout for shape-inside property
     4        https://bugs.webkit.org/show_bug.cgi?id=102571
     5
     6        Reviewed by David Hyatt.
     7
     8        Test that the shape-outside value correctly propagates to shape-inside
     9        when shape-inside has a value of 'outside-shape,' using both an
     10        undefined and a simple shape outside value.
     11
     12        * fast/exclusions/shape-inside/shape-inside-outside-shape-expected.html: Added.
     13        * fast/exclusions/shape-inside/shape-inside-outside-shape.html: Added.
     14
    1152013-02-18  Zan Dobersek  <zdobersek@igalia.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r143224 r143225  
     12013-02-18  Bear Travis  <betravis@adobe.com>
     2
     3        [CSS Exclusions] Support outside-shape layout for shape-inside property
     4        https://bugs.webkit.org/show_bug.cgi?id=102571
     5
     6        Reviewed by David Hyatt.
     7
     8        A shape-inside value of 'outside-shape' should resolve to the value of
     9        the shape-outside property for layout. This patch introduces a helper
     10        method to resolve shape-inside in RenderStyle, and replaces calls to
     11        RenderStyle::shapeInside() when the resolved (layout) value should be
     12        used.
     13
     14        Test: fast/exclusions/shape-inside/shape-inside-outside-shape.html
     15
     16        * rendering/ExclusionShapeInfo.cpp:
     17        (WebCore::::computedShape): Use the resolved shape-inside getter.
     18        * rendering/ExclusionShapeInsideInfo.h:
     19        (WebCore::ExclusionShapeInsideInfo::isEnabledFor): Ditto.
     20        (WebCore::ExclusionShapeInsideInfo::ExclusionShapeInsideInfo): Ditto.
     21        * rendering/RenderBlock.cpp:
     22        (WebCore::RenderBlock::styleDidChange): Ditto.
     23        (WebCore::RenderBlock::exclusionShapeInsideInfo): Ditto.
     24        * rendering/style/RenderStyle.h: Add the resolved shape inside getter.
     25
    1262013-02-18  Pavel Feldman  <pfeldman@chromium.org>
    227
  • trunk/Source/WebCore/rendering/ExclusionShapeInfo.cpp

    r142164 r143225  
    5555}
    5656
    57 template class ExclusionShapeInfo<RenderBlock, &RenderStyle::shapeInside>;
     57template class ExclusionShapeInfo<RenderBlock, &RenderStyle::resolvedShapeInside>;
    5858template class ExclusionShapeInfo<RenderBox, &RenderStyle::shapeOutside>;
    5959}
  • trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.h

    r143010 r143225  
    5353typedef Vector<LineSegmentRange> SegmentRangeList;
    5454
    55 class ExclusionShapeInsideInfo : public ExclusionShapeInfo<RenderBlock, &RenderStyle::shapeInside>, public MappedInfo<RenderBlock, ExclusionShapeInsideInfo> {
     55class ExclusionShapeInsideInfo : public ExclusionShapeInfo<RenderBlock, &RenderStyle::resolvedShapeInside>, public MappedInfo<RenderBlock, ExclusionShapeInsideInfo> {
    5656public:
    5757    static PassOwnPtr<ExclusionShapeInsideInfo> createInfo(const RenderBlock* renderer) { return adoptPtr(new ExclusionShapeInsideInfo(renderer)); }
     
    6060    {
    6161        // FIXME: Bug 89707: Enable shape inside for non-rectangular shapes
    62         ExclusionShapeValue* shapeValue = renderer->style()->shapeInside();
     62        ExclusionShapeValue* shapeValue = renderer->style()->resolvedShapeInside();
    6363        BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue::SHAPE) ? shapeValue->shape() : 0;
    6464        return shape && shape->type() != BasicShape::BASIC_SHAPE_ELLIPSE;
     
    9090
    9191private:
    92     ExclusionShapeInsideInfo(const RenderBlock* renderer) : ExclusionShapeInfo<RenderBlock, &RenderStyle::shapeInside>(renderer) { }
     92    ExclusionShapeInsideInfo(const RenderBlock* renderer) : ExclusionShapeInfo<RenderBlock, &RenderStyle::resolvedShapeInside>(renderer) { }
    9393
    9494    LayoutUnit m_shapeLineTop;
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r143042 r143225  
    345345    // FIXME: Bug 89993: Style changes should affect the ExclusionShapeInsideInfos for other render blocks that
    346346    // share the same ExclusionShapeInsideInfo
    347     updateExclusionShapeInsideInfoAfterStyleChange(style()->shapeInside(), oldStyle ? oldStyle->shapeInside() : 0);
     347    updateExclusionShapeInsideInfoAfterStyleChange(style()->resolvedShapeInside(), oldStyle ? oldStyle->resolvedShapeInside() : 0);
    348348#endif
    349349
     
    13741374ExclusionShapeInsideInfo* RenderBlock::exclusionShapeInsideInfo() const
    13751375{
    1376     return style()->shapeInside() && ExclusionShapeInsideInfo::isEnabledFor(this) ? ExclusionShapeInsideInfo::info(this) : 0;
     1376    return style()->resolvedShapeInside() && ExclusionShapeInsideInfo::isEnabledFor(this) ? ExclusionShapeInsideInfo::info(this) : 0;
    13771377}
    13781378
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r142974 r143225  
    14221422    }
    14231423    ExclusionShapeValue* shapeInside() const { return rareNonInheritedData->m_shapeInside.get(); }
     1424    ExclusionShapeValue* resolvedShapeInside() const
     1425    {
     1426        ExclusionShapeValue* shapeInside = this->shapeInside();
     1427        if (shapeInside && shapeInside->type() == ExclusionShapeValue::OUTSIDE)
     1428            return shapeOutside();
     1429        return shapeInside;
     1430    }
    14241431
    14251432    void setShapeOutside(PassRefPtr<ExclusionShapeValue> value)
Note: See TracChangeset for help on using the changeset viewer.