Changeset 47403 in webkit


Ignore:
Timestamp:
Aug 17, 2009 5:58:10 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-08-17 Roland Steiner <rolandsteiner@google.com>

Reviewed by Eric Seidel.

Moved implementation of isAfterContent to RenderObject
(as inline method to avoid potential performance regressions).

BUG 28376 - [Cleanup] isAfterContent() implemented twice, should be member of RenderObject
(https://bugs.webkit.org/show_bug.cgi?id=28376)

  • rendering/RenderBox.cpp:
  • rendering/RenderBox.h:
  • rendering/RenderInline.cpp:
  • rendering/RenderObject.h: (WebCore::RenderObject::isAfterContent):
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r47400 r47403  
     12009-08-17  Roland Steiner  <rolandsteiner@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Moved implementation of isAfterContent to RenderObject
     6        (as inline method to avoid potential performance regressions).
     7
     8        BUG 28376 -  [Cleanup] isAfterContent() implemented twice, should be member of RenderObject
     9        (https://bugs.webkit.org/show_bug.cgi?id=28376)
     10
     11        * rendering/RenderBox.cpp:
     12        * rendering/RenderBox.h:
     13        * rendering/RenderInline.cpp:
     14        * rendering/RenderObject.h:
     15        (WebCore::RenderObject::isAfterContent):
     16
    1172009-08-17  Shinichiro Hamaji  <hamaji@chromium.org>
    218
  • trunk/WebCore/rendering/RenderBox.cpp

    r47163 r47403  
    26562656}
    26572657
    2658 bool RenderBox::isAfterContent(RenderObject* child) const
    2659 {
    2660     return (child && child->style()->styleType() == AFTER && (!child->isText() || child->isBR()));
    2661 }
    2662 
    26632658VisiblePosition RenderBox::positionForPoint(const IntPoint& point)
    26642659{
  • trunk/WebCore/rendering/RenderBox.h

    r47163 r47403  
    335335    virtual void calcPrefWidths() { setPrefWidthsDirty(false); }
    336336
    337 protected:
    338     bool isAfterContent(RenderObject* child) const;
    339 
    340337private:
    341338    // The width/height of the contents + borders + padding.  The x/y location is relative to our container (which is not always our parent).
  • trunk/WebCore/rendering/RenderInline.cpp

    r46815 r47403  
    132132}
    133133
    134 static inline bool isAfterContent(RenderObject* child)
    135 {
    136     if (!child)
    137         return false;
    138     if (child->style()->styleType() != AFTER)
    139         return false;
    140     // Text nodes don't have their own styles, so ignore the style on a text node.
    141     if (child->isText() && !child->isBR())
    142         return false;
    143     return true;
    144 }
    145 
    146134void RenderInline::addChild(RenderObject* newChild, RenderObject* beforeChild)
    147135{
  • trunk/WebCore/rendering/RenderObject.h

    r45612 r47403  
    286286    bool isHTMLMarquee() const;
    287287
     288    inline bool isAfterContent() const;
     289    static inline bool isAfterContent(const RenderObject* obj) { return obj && obj->isAfterContent(); }
     290
    288291    bool childrenInline() const { return m_childrenInline; }
    289292    void setChildrenInline(bool b = true) { m_childrenInline = b; }
     
    859862}
    860863
     864inline bool RenderObject::isAfterContent() const
     865{
     866    if (style()->styleType() != AFTER)
     867        return false;
     868    // Text nodes don't have their own styles, so ignore the style on a text node.
     869    if (isText() && !isBR())
     870        return false;
     871    return true;
     872}
     873
    861874inline void RenderObject::setNeedsLayout(bool b, bool markParents)
    862875{
Note: See TracChangeset for help on using the changeset viewer.