Changeset 147495 in webkit


Ignore:
Timestamp:
Apr 2, 2013 2:18:09 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Exclusions] refactor shape-outside code to use isFloatingWithShapeOutside() helper method
https://bugs.webkit.org/show_bug.cgi?id=113799

Patch by Bem Jones-Bey <Bem Jones-Bey> on 2013-04-02
Reviewed by Dirk Schulze.

When reviewing my patch for bug 110349, Julien mentioned that the
common test for floating with shape outside should be factored out.
This patch does that.

No new functionality, so no new tests.

  • rendering/ExclusionShapeOutsideInfo.cpp:

(WebCore::ExclusionShapeOutsideInfo::isEnabledFor): Use helper method.

  • rendering/RenderBox.h:

(WebCore::RenderBox::exclusionShapeOutsideInfo): Ditto.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::shouldBeNormalFlowOnly): Ditto.

  • rendering/RenderObject.h:

(WebCore::RenderObject::hasPaintOffset): Ditto.
(WebCore::RenderObject::isFloatingWithShapeOutside): Add method to

encapsulate the common test.

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147494 r147495  
     12013-04-02  Bem Jones-Bey  <bjonesbe@adobe.com>
     2
     3        [CSS Exclusions] refactor shape-outside code to use isFloatingWithShapeOutside() helper method
     4        https://bugs.webkit.org/show_bug.cgi?id=113799
     5
     6        Reviewed by Dirk Schulze.
     7
     8        When reviewing my patch for bug 110349, Julien mentioned that the
     9        common test for floating with shape outside should be factored out.
     10        This patch does that.
     11
     12        No new functionality, so no new tests.
     13
     14        * rendering/ExclusionShapeOutsideInfo.cpp:
     15        (WebCore::ExclusionShapeOutsideInfo::isEnabledFor): Use helper method.
     16        * rendering/RenderBox.h:
     17        (WebCore::RenderBox::exclusionShapeOutsideInfo): Ditto.
     18        * rendering/RenderLayer.cpp:
     19        (WebCore::RenderLayer::shouldBeNormalFlowOnly): Ditto.
     20        * rendering/RenderObject.h:
     21        (WebCore::RenderObject::hasPaintOffset):  Ditto.
     22        (WebCore::RenderObject::isFloatingWithShapeOutside): Add method to
     23            encapsulate the common test.
     24
    1252013-04-02  Jer Noble  <jer.noble@apple.com>
    226
  • trunk/Source/WebCore/rendering/ExclusionShapeOutsideInfo.cpp

    r145982 r147495  
    4040{
    4141    ExclusionShapeValue* value = box->style()->shapeOutside();
    42     return (box->isFloating() && value && value->type() == ExclusionShapeValue::SHAPE) ? value->shape() : 0;
     42    return (box->isFloatingWithShapeOutside() && value->type() == ExclusionShapeValue::SHAPE) ? value->shape() : 0;
    4343}
    4444
  • trunk/Source/WebCore/rendering/RenderBox.h

    r147261 r147495  
    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() || (style()->shapeOutside() && isFloating()); }
     52    virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip() || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns() || !style()->hasAutoZIndex() || isFloatingWithShapeOutside(); }
    5353
    5454    virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const OVERRIDE;
     
    583583    ExclusionShapeOutsideInfo* exclusionShapeOutsideInfo() const
    584584    {
    585         return style()->shapeOutside() && ExclusionShapeOutsideInfo::isEnabledFor(this) ? ExclusionShapeOutsideInfo::info(this) : 0;
     585        return isFloatingWithShapeOutside() && ExclusionShapeOutsideInfo::isEnabledFor(this) ? ExclusionShapeOutsideInfo::info(this) : 0;
    586586    }
    587587#endif
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r147472 r147495  
    58485848            && !needsCompositedScrolling()
    58495849#if ENABLE(CSS_EXCLUSIONS)
    5850             && !(renderer()->isFloating() && renderer()->style()->shapeOutside())
     5850            && !renderer()->isFloatingWithShapeOutside()
    58515851#endif
    58525852            ;
  • trunk/Source/WebCore/rendering/RenderObject.h

    r147414 r147495  
    555555        // Shape outside on a float can reposition the float in much the
    556556        // same way as relative positioning, so treat it as such.
    557         positioned = positioned || (m_bitfields.floating() && m_bitfields.isBox() && style()->shapeOutside());
     557        positioned = positioned || isFloatingWithShapeOutside();
    558558#endif
    559559        return positioned;
     
    880880
    881881    bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOutOfFlowPositioned()); }
     882    bool isFloatingWithShapeOutside() const { return isBox() && isFloating() && style()->shapeOutside(); }
    882883
    883884    bool isTransparent() const { return style()->opacity() < 1.0f; }
Note: See TracChangeset for help on using the changeset viewer.