Changeset 153330 in webkit


Ignore:
Timestamp:
Jul 25, 2013 9:40:40 AM (11 years ago)
Author:
betravis@adobe.com
Message:

[CSS Shapes] Shape methods and member variables should be guarded with the CSS_SHAPES flag
https://bugs.webkit.org/show_bug.cgi?id=117277

Reviewed by Alexandru Chiculita.

This patch adds some compile guards that were missing from the RenderStyle and
StyleRareNonInheritedData files. When the compile guard caused parameters to
not be used, the parameters were marked using UNUSED_PARAM.

  • css/CSSPropertyNames.in: Inserting a line to trigger build.
  • rendering/RenderBlock.cpp:

(WebCore::shapeInfoRequiresRelayout):
(WebCore::RenderBlock::updateRegionsAndShapesBeforeChildLayout):
(WebCore::RenderBlock::logicalRightFloatOffsetForLine):

  • rendering/RenderBox.cpp:

(WebCore::isCandidateForOpaquenessTest):

  • rendering/RenderBox.h:
  • rendering/RenderObject.h:
  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::changeRequiresLayout):
(WebCore::RenderStyle::changeRequiresRepaint):

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

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

  • rendering/style/StyleRareNonInheritedData.h:
Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r153297 r153330  
     12013-07-25  Bear Travis  <betravis@adobe.com>
     2
     3        [CSS Shapes] Shape methods and member variables should be guarded with the CSS_SHAPES flag
     4        https://bugs.webkit.org/show_bug.cgi?id=117277
     5
     6        Reviewed by Alexandru Chiculita.
     7
     8        This patch adds some compile guards that were missing from the RenderStyle and
     9        StyleRareNonInheritedData files. When the compile guard caused parameters to
     10        not be used, the parameters were marked using UNUSED_PARAM.
     11
     12        * css/CSSPropertyNames.in: Inserting a line to trigger build.
     13        * rendering/RenderBlock.cpp:
     14        (WebCore::shapeInfoRequiresRelayout):
     15        (WebCore::RenderBlock::updateRegionsAndShapesBeforeChildLayout):
     16        (WebCore::RenderBlock::logicalRightFloatOffsetForLine):
     17        * rendering/RenderBox.cpp:
     18        (WebCore::isCandidateForOpaquenessTest):
     19        * rendering/RenderBox.h:
     20        * rendering/RenderObject.h:
     21        * rendering/style/RenderStyle.cpp:
     22        (WebCore::RenderStyle::changeRequiresLayout):
     23        (WebCore::RenderStyle::changeRequiresRepaint):
     24        * rendering/style/RenderStyle.h:
     25        * rendering/style/StyleRareNonInheritedData.cpp:
     26        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     27        (WebCore::StyleRareNonInheritedData::operator==):
     28        * rendering/style/StyleRareNonInheritedData.h:
     29
    1302013-07-24  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    231
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r152479 r153330  
    88// http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp
    99//
     10
    1011
    1112// high-priority property names have to be listed first, to simplify the check
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r153060 r153330  
    14691469#endif
    14701470
     1471#if ENABLE(CSS_SHAPES)
    14711472static inline bool shapeInfoRequiresRelayout(const RenderBlock* block)
    14721473{
    1473 #if !ENABLE(CSS_SHAPES)
    1474     return false;
    1475 #else
    14761474    ShapeInsideInfo* info = block->shapeInsideInfo();
    14771475    if (info)
     
    14801478        info = block->layoutShapeInsideInfo();
    14811479    return info && info->needsLayout();
     1480}
    14821481#endif
    1483 }
    14841482
    14851483bool RenderBlock::updateRegionsAndShapesBeforeChildLayout(RenderFlowThread* flowThread)
     
    14871485#if ENABLE(CSS_SHAPES)
    14881486    if (!flowThread && !shapeInsideInfo())
     1487        return shapeInfoRequiresRelayout(this);
    14891488#else
    14901489    if (!flowThread)
     1490        return false;
    14911491#endif
    1492         return shapeInfoRequiresRelayout(this);
    14931492
    14941493    LayoutUnit oldHeight = logicalHeight();
     
    15101509    setLogicalHeight(oldHeight);
    15111510    setLogicalTop(oldTop);
    1512    
     1511
     1512#if ENABLE(CSS_SHAPES)
    15131513    return shapeInfoRequiresRelayout(this);
     1514#else
     1515    return false;
     1516#endif
    15141517}
    15151518
     
    45504553            }
    45514554        }
     4555#else
     4556        UNUSED_PARAM(offsetMode);
    45524557#endif
    45534558
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r153089 r153330  
    12251225    if (childStyle->position() != StaticPosition && childBox->containingBlock() != childBox->parent())
    12261226        return false;
    1227     if (childStyle->visibility() != VISIBLE || childStyle->shapeOutside())
     1227    if (childStyle->visibility() != VISIBLE)
    12281228        return false;
     1229#if ENABLE(CSS_SHAPES)
     1230    if (childStyle->shapeOutside())
     1231        return false;
     1232#endif
    12291233    if (!childBox->width() || !childBox->height())
    12301234        return false;
  • trunk/Source/WebCore/rendering/RenderBox.h

    r153089 r153330  
    5050    // hasAutoZIndex only returns true if the element is positioned or a flex-item since
    5151    // position:static elements that are not flex-items get their z-index coerced to auto.
    52     virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip() || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns() || !style()->hasAutoZIndex() || isFloatingWithShapeOutside(); }
     52    virtual bool requiresLayer() const OVERRIDE
     53    {
     54        return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip()
     55            || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns()
     56#if ENABLE(CSS_SHAPES)
     57            || isFloatingWithShapeOutside()
     58#endif
     59            || !style()->hasAutoZIndex();
     60    }
    5361
    5462    virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const OVERRIDE;
  • trunk/Source/WebCore/rendering/RenderObject.h

    r152320 r153330  
    865865
    866866    bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOutOfFlowPositioned()); }
     867#if ENABLE(CSS_SHAPES)
    867868    bool isFloatingWithShapeOutside() const { return isBox() && isFloating() && style()->shapeOutside(); }
     869#endif
    868870
    869871    bool isTransparent() const { return style()->opacity() < 1.0f; }
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r152911 r153330  
    403403
    404404        if (rareNonInheritedData->m_wrapFlow != other->rareNonInheritedData->m_wrapFlow
    405             || rareNonInheritedData->m_wrapThrough != other->rareNonInheritedData->m_wrapThrough
    406             || rareNonInheritedData->m_shapeMargin != other->rareNonInheritedData->m_shapeMargin
     405            || rareNonInheritedData->m_wrapThrough != other->rareNonInheritedData->m_wrapThrough)
     406            return true;
     407
     408#if ENABLE(CSS_SHAPES)
     409        if (rareNonInheritedData->m_shapeMargin != other->rareNonInheritedData->m_shapeMargin
    407410            || rareNonInheritedData->m_shapePadding != other->rareNonInheritedData->m_shapePadding)
    408411            return true;
     412#endif
    409413
    410414        if (rareNonInheritedData->m_deprecatedFlexibleBox.get() != other->rareNonInheritedData->m_deprecatedFlexibleBox.get()
     
    696700        || rareInheritedData->m_imageRendering != other->rareInheritedData->m_imageRendering)
    697701        return true;
    698        
     702
     703#if ENABLE(CSS_SHAPES)
    699704    // FIXME: The current spec is being reworked to remove dependencies between exclusions and affected
    700705    // content. There's a proposal to use floats instead. In that case, wrap-shape should actually relayout
     
    704709    if (rareNonInheritedData->m_shapeOutside != other->rareNonInheritedData->m_shapeOutside)
    705710        return true;
     711#endif
    706712
    707713    if (rareNonInheritedData->m_clipPath != other->rareNonInheritedData->m_clipPath)
     
    17391745}
    17401746
     1747#if ENABLE(CSS_SHAPES)
    17411748ShapeValue* RenderStyle::initialShapeInside()
    17421749{
     
    17441751    return sOutsideValue.get();
    17451752}
     1753#endif
    17461754
    17471755void RenderStyle::setColumnStylesFromPaginationMode(const Pagination::Mode& paginationMode)
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r152911 r153330  
    14661466#endif
    14671467
     1468#if ENABLE(CSS_SHAPES)
    14681469    void setShapeInside(PassRefPtr<ShapeValue> value)
    14691470    {
     
    14921493    static ShapeValue* initialShapeOutside() { return 0; }
    14931494
    1494     void setClipPath(PassRefPtr<ClipPathOperation> operation)
    1495     {
    1496         if (rareNonInheritedData->m_clipPath != operation)
    1497             rareNonInheritedData.access()->m_clipPath = operation;
    1498     }
    1499     ClipPathOperation* clipPath() const { return rareNonInheritedData->m_clipPath.get(); }
    1500 
    1501     static ClipPathOperation* initialClipPath() { return 0; }
    1502 
    15031495    Length shapePadding() const { return rareNonInheritedData->m_shapePadding; }
    15041496    void setShapePadding(Length shapePadding) { SET_VAR(rareNonInheritedData, m_shapePadding, shapePadding); }
     
    15081500    void setShapeMargin(Length shapeMargin) { SET_VAR(rareNonInheritedData, m_shapeMargin, shapeMargin); }
    15091501    static Length initialShapeMargin() { return Length(0, Fixed); }
     1502#endif
     1503
     1504    void setClipPath(PassRefPtr<ClipPathOperation> operation)
     1505    {
     1506        if (rareNonInheritedData->m_clipPath != operation)
     1507            rareNonInheritedData.access()->m_clipPath = operation;
     1508    }
     1509    ClipPathOperation* clipPath() const { return rareNonInheritedData->m_clipPath.get(); }
     1510
     1511    static ClipPathOperation* initialClipPath() { return 0; }
    15101512
    15111513    bool hasContent() const { return contentData(); }
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r151394 r153330  
    4747    , m_mask(FillLayer(MaskFillLayer))
    4848    , m_pageSize()
     49#if ENABLE(CSS_SHAPES)
    4950    , m_shapeInside(RenderStyle::initialShapeInside())
    5051    , m_shapeOutside(RenderStyle::initialShapeOutside())
    5152    , m_shapeMargin(RenderStyle::initialShapeMargin())
    5253    , m_shapePadding(RenderStyle::initialShapePadding())
     54#endif
    5355    , m_clipPath(RenderStyle::initialClipPath())
    5456    , m_visitedLinkBackgroundColor(RenderStyle::initialBackgroundColor())
     
    121123    , m_maskBoxImage(o.m_maskBoxImage)
    122124    , m_pageSize(o.m_pageSize)
     125#if ENABLE(CSS_SHAPES)
    123126    , m_shapeInside(o.m_shapeInside)
    124127    , m_shapeOutside(o.m_shapeOutside)
    125128    , m_shapeMargin(o.m_shapeMargin)
    126129    , m_shapePadding(o.m_shapePadding)
     130#endif
    127131    , m_clipPath(o.m_clipPath)
    128132#if ENABLE(CSS3_TEXT)
     
    210214        && m_maskBoxImage == o.m_maskBoxImage
    211215        && m_pageSize == o.m_pageSize
     216#if ENABLE(CSS_SHAPES)
    212217        && m_shapeInside == o.m_shapeInside
    213218        && m_shapeOutside == o.m_shapeOutside
    214219        && m_shapeMargin == o.m_shapeMargin
    215220        && m_shapePadding == o.m_shapePadding
     221#endif
    216222        && m_clipPath == o.m_clipPath
    217223#if ENABLE(CSS3_TEXT)
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r151402 r153330  
    137137    LengthSize m_pageSize;
    138138
     139#if ENABLE(CSS_SHAPES)
    139140    RefPtr<ShapeValue> m_shapeInside;
    140141    RefPtr<ShapeValue> m_shapeOutside;
    141142    Length m_shapeMargin;
    142143    Length m_shapePadding;
     144#endif
    143145
    144146    RefPtr<ClipPathOperation> m_clipPath;
Note: See TracChangeset for help on using the changeset viewer.