Changeset 129787 in webkit


Ignore:
Timestamp:
Sep 27, 2012 12:23:40 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Exclusions] Rename RenderStyle::wrapShapeInside/Outside to shapeInside/Outside
https://bugs.webkit.org/show_bug.cgi?id=97707

Patch by Bear Travis <betravis@adobe.com> on 2012-09-27
Reviewed by Antti Koivisto.

The exclusions specification has renamed wrap-shape-inside and wrap-shape-outside
to shape-inside and shape-outside. We should rename the getter/setter functions
in RenderStyle, and update the derived variable and function names accordingly.
For more information, see: http://dev.w3.org/csswg/css3-exclusions/#declaring-shapes

Covered by existing tests. No new functionality.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/StyleBuilder.cpp:

(WebCore::ApplyPropertyExclusionShape::applyValue):
(WebCore::StyleBuilder::StyleBuilder):

  • rendering/ExclusionShapeInsideInfo.cpp:

(WebCore::ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock):
(WebCore::ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock):
(WebCore::ExclusionShapeInsideInfo::removeExclusionShapeInsideInfoForRenderBlock):
(WebCore::ExclusionShapeInsideInfo::computeShapeSize):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::styleDidChange):
(WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange):

  • rendering/RenderBlock.h:

(WebCore::RenderBlock::exclusionShapeInsideInfo):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::diff):

  • rendering/style/RenderStyle.h:
  • rendering/style/StyleRareNonInheritedData.cpp:

(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
(WebCore::StyleRareNonInheritedData::reportMemoryUsage):

  • rendering/style/StyleRareNonInheritedData.h:

(StyleRareNonInheritedData):

Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r129786 r129787  
     12012-09-27  Bear Travis  <betravis@adobe.com>
     2
     3        [CSS Exclusions] Rename RenderStyle::wrapShapeInside/Outside to shapeInside/Outside
     4        https://bugs.webkit.org/show_bug.cgi?id=97707
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The exclusions specification has renamed wrap-shape-inside and wrap-shape-outside
     9        to shape-inside and shape-outside. We should rename the getter/setter functions
     10        in RenderStyle, and update the derived variable and function names accordingly.
     11        For more information, see: http://dev.w3.org/csswg/css3-exclusions/#declaring-shapes
     12
     13        Covered by existing tests. No new functionality.
     14
     15        * css/CSSComputedStyleDeclaration.cpp:
     16        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     17        * css/StyleBuilder.cpp:
     18        (WebCore::ApplyPropertyExclusionShape::applyValue):
     19        (WebCore::StyleBuilder::StyleBuilder):
     20        * rendering/ExclusionShapeInsideInfo.cpp:
     21        (WebCore::ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock):
     22        (WebCore::ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock):
     23        (WebCore::ExclusionShapeInsideInfo::removeExclusionShapeInsideInfoForRenderBlock):
     24        (WebCore::ExclusionShapeInsideInfo::computeShapeSize):
     25        * rendering/RenderBlock.cpp:
     26        (WebCore::RenderBlock::styleDidChange):
     27        (WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange):
     28        * rendering/RenderBlock.h:
     29        (WebCore::RenderBlock::exclusionShapeInsideInfo):
     30        * rendering/style/RenderStyle.cpp:
     31        (WebCore::RenderStyle::diff):
     32        * rendering/style/RenderStyle.h:
     33        * rendering/style/StyleRareNonInheritedData.cpp:
     34        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     35        (WebCore::StyleRareNonInheritedData::operator==):
     36        (WebCore::StyleRareNonInheritedData::reportMemoryUsage):
     37        * rendering/style/StyleRareNonInheritedData.h:
     38        (StyleRareNonInheritedData):
     39
    1402012-09-27  Michael Saboff  <msaboff@apple.com>
    241
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r129018 r129787  
    24442444            return cssValuePool().createValue(style->wrapPadding());
    24452445        case CSSPropertyWebkitShapeInside:
    2446             if (!style->wrapShapeInside())
     2446            if (!style->shapeInside())
    24472447                return cssValuePool().createIdentifierValue(CSSValueAuto);
    2448             return valueForBasicShape(style->wrapShapeInside());
     2448            return valueForBasicShape(style->shapeInside());
    24492449        case CSSPropertyWebkitShapeOutside:
    2450             if (!style->wrapShapeOutside())
     2450            if (!style->shapeOutside())
    24512451                return cssValuePool().createIdentifierValue(CSSValueAuto);
    2452             return valueForBasicShape(style->wrapShapeOutside());
     2452            return valueForBasicShape(style->shapeOutside());
    24532453        case CSSPropertyWebkitWrapThrough:
    24542454            return cssValuePool().createValue(style->wrapThrough());
  • trunk/Source/WebCore/css/StyleBuilder.cpp

    r128700 r129787  
    17101710#if ENABLE(CSS_EXCLUSIONS)
    17111711template <BasicShape* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<BasicShape>), BasicShape* (*initialFunction)()>
    1712 class ApplyPropertyWrapShape {
     1712class ApplyPropertyExclusionShape {
    17131713public:
    17141714    static void setValue(RenderStyle* style, PassRefPtr<BasicShape> value) { (style->*setterFunction)(value); }
     
    17201720                setValue(styleResolver->style(), 0);
    17211721            else if (primitiveValue->isShape()) {
    1722                 RefPtr<BasicShape> wrapShape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue());
    1723                 setValue(styleResolver->style(), wrapShape.release());
     1722                RefPtr<BasicShape> shape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue());
     1723                setValue(styleResolver->style(), shape.release());
    17241724            }
    17251725        }
     
    20612061    setPropertyHandler(CSSPropertyWebkitWrapPadding, ApplyPropertyLength<&RenderStyle::wrapPadding, &RenderStyle::setWrapPadding, &RenderStyle::initialWrapPadding>::createHandler());
    20622062    setPropertyHandler(CSSPropertyWebkitWrapThrough, ApplyPropertyDefault<WrapThrough, &RenderStyle::wrapThrough, WrapThrough, &RenderStyle::setWrapThrough, WrapThrough, &RenderStyle::initialWrapThrough>::createHandler());
    2063     setPropertyHandler(CSSPropertyWebkitShapeInside, ApplyPropertyWrapShape<&RenderStyle::wrapShapeInside, &RenderStyle::setWrapShapeInside, &RenderStyle::initialWrapShapeInside>::createHandler());
    2064     setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyPropertyWrapShape<&RenderStyle::wrapShapeOutside, &RenderStyle::setWrapShapeOutside, &RenderStyle::initialWrapShapeOutside>::createHandler());
     2063    setPropertyHandler(CSSPropertyWebkitShapeInside, ApplyPropertyExclusionShape<&RenderStyle::shapeInside, &RenderStyle::setShapeInside, &RenderStyle::initialShapeInside>::createHandler());
     2064    setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyPropertyExclusionShape<&RenderStyle::shapeOutside, &RenderStyle::setShapeOutside, &RenderStyle::initialShapeOutside>::createHandler());
    20652065#endif
    20662066    setPropertyHandler(CSSPropertyWhiteSpace, ApplyPropertyDefault<EWhiteSpace, &RenderStyle::whiteSpace, EWhiteSpace, &RenderStyle::setWhiteSpace, EWhiteSpace, &RenderStyle::initialWhiteSpace>::createHandler());
  • trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.cpp

    r129689 r129787  
    6666ExclusionShapeInsideInfo* ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock(const RenderBlock* block)
    6767{
    68     ASSERT(block->style()->wrapShapeInside());
     68    ASSERT(block->style()->shapeInside());
    6969    return exclusionShapeInsideInfoMap().get(block);
    7070}
     
    7373{
    7474    // FIXME: Bug 89707: Enable shape inside for non-rectangular shapes
    75     BasicShape* shape = block->style()->wrapShapeInside();
     75    BasicShape* shape = block->style()->shapeInside();
    7676    return (shape && shape->type() == BasicShape::BASIC_SHAPE_RECTANGLE);
    7777}
     
    7979void ExclusionShapeInsideInfo::removeExclusionShapeInsideInfoForRenderBlock(const RenderBlock* block)
    8080{
    81     if (!block->style() || !block->style()->wrapShapeInside())
     81    if (!block->style() || !block->style()->shapeInside())
    8282        return;
    8383    exclusionShapeInsideInfoMap().remove(block);
     
    9494
    9595    // FIXME: Bug 89993: The wrap shape may come from the parent object
    96     BasicShape* shape = m_block->style()->wrapShapeInside();
     96    BasicShape* shape = m_block->style()->shapeInside();
    9797    ASSERT(shape);
    9898
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r129689 r129787  
    331331    // FIXME: Bug 89993: Style changes should affect the ExclusionShapeInsideInfos for other render blocks that
    332332    // share the same ExclusionShapeInsideInfo
    333     updateExclusionShapeInsideInfoAfterStyleChange(style()->wrapShapeInside(), oldStyle ? oldStyle->wrapShapeInside() : 0);
     333    updateExclusionShapeInsideInfoAfterStyleChange(style()->shapeInside(), oldStyle ? oldStyle->shapeInside() : 0);
    334334#endif
    335335
     
    13811381
    13821382#if ENABLE(CSS_EXCLUSIONS)
    1383 void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape* wrapShape, const BasicShape* oldWrapShape)
     1383void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape* shapeInside, const BasicShape* oldShapeInside)
    13841384{
    13851385    // FIXME: A future optimization would do a deep comparison for equality.
    1386     if (wrapShape == oldWrapShape)
    1387         return;
    1388 
    1389     if (wrapShape) {
     1386    if (shapeInside == oldShapeInside)
     1387        return;
     1388
     1389    if (shapeInside) {
    13901390        ExclusionShapeInsideInfo* exclusionShapeInsideInfo = ExclusionShapeInsideInfo::ensureExclusionShapeInsideInfoForRenderBlock(this);
    13911391        exclusionShapeInsideInfo->dirtyShapeSize();
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r129689 r129787  
    405405    ExclusionShapeInsideInfo* exclusionShapeInsideInfo() const
    406406    {
    407         return style()->wrapShapeInside() && ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(this) ? ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock(this) : 0;
     407        return style()->shapeInside() && ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(this) ? ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock(this) : 0;
    408408    }
    409409#endif
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r129466 r129787  
    459459
    460460#if ENABLE(CSS_EXCLUSIONS)
    461         if (rareNonInheritedData->m_wrapShapeInside != other->rareNonInheritedData->m_wrapShapeInside)
     461        if (rareNonInheritedData->m_shapeInside != other->rareNonInheritedData->m_shapeInside)
    462462            return StyleDifferenceLayout;
    463463#endif
     
    680680        // to avoid having diff() == StyleDifferenceEqual where wrap-shapes actually differ.
    681681        // Tracking bug: https://bugs.webkit.org/show_bug.cgi?id=62991
    682         if (rareNonInheritedData->m_wrapShapeOutside != other->rareNonInheritedData->m_wrapShapeOutside)
     682        if (rareNonInheritedData->m_shapeOutside != other->rareNonInheritedData->m_shapeOutside)
    683683            return StyleDifferenceRepaint;
    684684
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r128700 r129787  
    14461446#endif
    14471447
    1448     void setWrapShapeInside(PassRefPtr<BasicShape> shape)
    1449     {
    1450         if (rareNonInheritedData->m_wrapShapeInside != shape)
    1451             rareNonInheritedData.access()->m_wrapShapeInside = shape;
    1452     }
    1453     BasicShape* wrapShapeInside() const { return rareNonInheritedData->m_wrapShapeInside.get(); }
    1454 
    1455     void setWrapShapeOutside(PassRefPtr<BasicShape> shape)
    1456     {
    1457         if (rareNonInheritedData->m_wrapShapeOutside != shape)
    1458             rareNonInheritedData.access()->m_wrapShapeOutside = shape;
    1459     }
    1460     BasicShape* wrapShapeOutside() const { return rareNonInheritedData->m_wrapShapeOutside.get(); }
    1461 
    1462     static BasicShape* initialWrapShapeInside() { return 0; }
    1463     static BasicShape* initialWrapShapeOutside() { return 0; }
     1448    void setShapeInside(PassRefPtr<BasicShape> shape)
     1449    {
     1450        if (rareNonInheritedData->m_shapeInside != shape)
     1451            rareNonInheritedData.access()->m_shapeInside = shape;
     1452    }
     1453    BasicShape* shapeInside() const { return rareNonInheritedData->m_shapeInside.get(); }
     1454
     1455    void setShapeOutside(PassRefPtr<BasicShape> shape)
     1456    {
     1457        if (rareNonInheritedData->m_shapeOutside != shape)
     1458            rareNonInheritedData.access()->m_shapeOutside = shape;
     1459    }
     1460    BasicShape* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
     1461
     1462    static BasicShape* initialShapeInside() { return 0; }
     1463    static BasicShape* initialShapeOutside() { return 0; }
    14641464
    14651465    void setClipPath(PassRefPtr<ClipPathOperation> operation)
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r129466 r129787  
    4646    , m_mask(FillLayer(MaskFillLayer))
    4747    , m_pageSize()
    48     , m_wrapShapeInside(RenderStyle::initialWrapShapeInside())
    49     , m_wrapShapeOutside(RenderStyle::initialWrapShapeOutside())
     48    , m_shapeInside(RenderStyle::initialShapeInside())
     49    , m_shapeOutside(RenderStyle::initialShapeOutside())
    5050    , m_wrapMargin(RenderStyle::initialWrapMargin())
    5151    , m_wrapPadding(RenderStyle::initialWrapPadding())
     
    117117    , m_maskBoxImage(o.m_maskBoxImage)
    118118    , m_pageSize(o.m_pageSize)
    119     , m_wrapShapeInside(o.m_wrapShapeInside)
    120     , m_wrapShapeOutside(o.m_wrapShapeOutside)
     119    , m_shapeInside(o.m_shapeInside)
     120    , m_shapeOutside(o.m_shapeOutside)
    121121    , m_wrapMargin(o.m_wrapMargin)
    122122    , m_wrapPadding(o.m_wrapPadding)
     
    199199        && m_maskBoxImage == o.m_maskBoxImage
    200200        && m_pageSize == o.m_pageSize
    201         && m_wrapShapeInside == o.m_wrapShapeInside
    202         && m_wrapShapeOutside == o.m_wrapShapeOutside
     201        && m_shapeInside == o.m_shapeInside
     202        && m_shapeOutside == o.m_shapeOutside
    203203        && m_wrapMargin == o.m_wrapMargin
    204204        && m_wrapPadding == o.m_wrapPadding
     
    326326    info.addMember(m_animations);
    327327    info.addMember(m_transitions);
    328     info.addMember(m_wrapShapeInside);
    329     info.addMember(m_wrapShapeOutside);
     328    info.addMember(m_shapeInside);
     329    info.addMember(m_shapeOutside);
    330330    info.addMember(m_clipPath);
    331331    info.addMember(m_flowThread);
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r128700 r129787  
    135135    LengthSize m_pageSize;
    136136
    137     RefPtr<BasicShape> m_wrapShapeInside;
    138     RefPtr<BasicShape> m_wrapShapeOutside;
     137    RefPtr<BasicShape> m_shapeInside;
     138    RefPtr<BasicShape> m_shapeOutside;
    139139    Length m_wrapMargin;
    140140    Length m_wrapPadding;
Note: See TracChangeset for help on using the changeset viewer.