Changeset 118961 in webkit


Ignore:
Timestamp:
May 30, 2012 1:30:51 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Rename offsetTopLeft in RenderBoxModelObject to something better
https://bugs.webkit.org/show_bug.cgi?id=85915

Patch by Shezan Baig <shezbaig.wk@gmail.com> on 2012-05-30
Reviewed by Darin Adler.

Renamed offsetTopLeft in RenderBoxModelObject to
adjustedPositionRelativeToOffsetParent, because it returns the given
startPoint after adjusting it to be relative to the top-left corner of
the offsetParent. The definition of offsetParent itself is non-trivial
and is documented within the body of RenderObject::offsetParent,
therefore I decided to reuse this term, as-is, in the name of this
function.

No new tests; no functional or visible changes.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::offsetLeft):
(WebCore::RenderBox::offsetTop):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
(WebCore::RenderBoxModelObject::offsetLeft):
(WebCore::RenderBoxModelObject::offsetTop):

  • rendering/RenderBoxModelObject.h:

(RenderBoxModelObject):

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::offsetLeft):
(WebCore::RenderInline::offsetTop):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r118957 r118961  
     12012-05-30  Shezan Baig  <shezbaig.wk@gmail.com>
     2
     3        Rename offsetTopLeft in RenderBoxModelObject to something better
     4        https://bugs.webkit.org/show_bug.cgi?id=85915
     5
     6        Reviewed by Darin Adler.
     7
     8        Renamed offsetTopLeft in RenderBoxModelObject to
     9        adjustedPositionRelativeToOffsetParent, because it returns the given
     10        startPoint after adjusting it to be relative to the top-left corner of
     11        the offsetParent.  The definition of offsetParent itself is non-trivial
     12        and is documented within the body of RenderObject::offsetParent,
     13        therefore I decided to reuse this term, as-is, in the name of this
     14        function.
     15
     16        No new tests; no functional or visible changes.
     17
     18        * rendering/RenderBox.cpp:
     19        (WebCore::RenderBox::offsetLeft):
     20        (WebCore::RenderBox::offsetTop):
     21        * rendering/RenderBoxModelObject.cpp:
     22        (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
     23        (WebCore::RenderBoxModelObject::offsetLeft):
     24        (WebCore::RenderBoxModelObject::offsetTop):
     25        * rendering/RenderBoxModelObject.h:
     26        (RenderBoxModelObject):
     27        * rendering/RenderInline.cpp:
     28        (WebCore::RenderInline::offsetLeft):
     29        (WebCore::RenderInline::offsetTop):
     30
    1312012-05-29  Adrienne Walker  <enne@google.com>
    232
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r118957 r118961  
    38363836LayoutUnit RenderBox::offsetLeft() const
    38373837{
    3838     return offsetTopLeft(topLeftLocation()).x();
     3838    return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x();
    38393839}
    38403840
    38413841LayoutUnit RenderBox::offsetTop() const
    38423842{
    3843     return offsetTopLeft(topLeftLocation()).y();
     3843    return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y();
    38443844}
    38453845
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r118562 r118961  
    516516}
    517517
    518 LayoutPoint RenderBoxModelObject::offsetTopLeft(const LayoutPoint& startPoint) const
     518LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const LayoutPoint& startPoint) const
    519519{
    520520    // If the element is the HTML body element or does not have an associated box
     
    554554{
    555555    // Note that RenderInline and RenderBox override this to pass a different
    556     // startPoint to offsetTopLeft.
    557     return offsetTopLeft(LayoutPoint()).x();
     556    // startPoint to adjustedPositionRelativeToOffsetParent.
     557    return adjustedPositionRelativeToOffsetParent(LayoutPoint()).x();
    558558}
    559559
     
    561561{
    562562    // Note that RenderInline and RenderBox override this to pass a different
    563     // startPoint to offsetTopLeft.
    564     return offsetTopLeft(LayoutPoint()).y();
     563    // startPoint to adjustedPositionRelativeToOffsetParent.
     564    return adjustedPositionRelativeToOffsetParent(LayoutPoint()).y();
    565565}
    566566
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.h

    r118551 r118961  
    226226    };
    227227
    228     LayoutPoint offsetTopLeft(const LayoutPoint&) const;
     228    LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const;
    229229
    230230    void calculateBackgroundImageGeometry(const FillLayer*, const LayoutRect& paintRect, BackgroundImageGeometry&);
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r118617 r118961  
    654654    if (InlineBox* firstBox = firstLineBoxIncludingCulling())
    655655        topLeft = flooredLayoutPoint(firstBox->topLeft());
    656     return offsetTopLeft(topLeft).x();
     656    return adjustedPositionRelativeToOffsetParent(topLeft).x();
    657657}
    658658
     
    662662    if (InlineBox* firstBox = firstLineBoxIncludingCulling())
    663663        topLeft = flooredLayoutPoint(firstBox->topLeft());
    664     return offsetTopLeft(topLeft).y();
     664    return adjustedPositionRelativeToOffsetParent(topLeft).y();
    665665}
    666666
Note: See TracChangeset for help on using the changeset viewer.