Title: [118961] trunk/Source/WebCore
Revision
118961
Author
[email protected]
Date
2012-05-30 13:30:51 -0700 (Wed, 30 May 2012)

Log Message

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

Patch by Shezan Baig <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118960 => 118961)


--- trunk/Source/WebCore/ChangeLog	2012-05-30 20:18:00 UTC (rev 118960)
+++ trunk/Source/WebCore/ChangeLog	2012-05-30 20:30:51 UTC (rev 118961)
@@ -1,3 +1,33 @@
+2012-05-30  Shezan Baig  <[email protected]>
+
+        Rename offsetTopLeft in RenderBoxModelObject to something better
+        https://bugs.webkit.org/show_bug.cgi?id=85915
+
+        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):
+
 2012-05-29  Adrienne Walker  <[email protected]>
 
         Transformed fixed position layers have an incorrect overlap map entry

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (118960 => 118961)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2012-05-30 20:18:00 UTC (rev 118960)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2012-05-30 20:30:51 UTC (rev 118961)
@@ -3835,12 +3835,12 @@
 
 LayoutUnit RenderBox::offsetLeft() const
 {
-    return offsetTopLeft(topLeftLocation()).x();
+    return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x();
 }
 
 LayoutUnit RenderBox::offsetTop() const
 {
-    return offsetTopLeft(topLeftLocation()).y();
+    return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y();
 }
 
 LayoutPoint RenderBox::flipForWritingModeForChild(const RenderBox* child, const LayoutPoint& point) const

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (118960 => 118961)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2012-05-30 20:18:00 UTC (rev 118960)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2012-05-30 20:30:51 UTC (rev 118961)
@@ -515,7 +515,7 @@
     return offset;
 }
 
-LayoutPoint RenderBoxModelObject::offsetTopLeft(const LayoutPoint& startPoint) const
+LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const LayoutPoint& startPoint) const
 {
     // If the element is the HTML body element or does not have an associated box
     // return 0 and stop this algorithm.
@@ -553,15 +553,15 @@
 LayoutUnit RenderBoxModelObject::offsetLeft() const
 {
     // Note that RenderInline and RenderBox override this to pass a different
-    // startPoint to offsetTopLeft.
-    return offsetTopLeft(LayoutPoint()).x();
+    // startPoint to adjustedPositionRelativeToOffsetParent.
+    return adjustedPositionRelativeToOffsetParent(LayoutPoint()).x();
 }
 
 LayoutUnit RenderBoxModelObject::offsetTop() const
 {
     // Note that RenderInline and RenderBox override this to pass a different
-    // startPoint to offsetTopLeft.
-    return offsetTopLeft(LayoutPoint()).y();
+    // startPoint to adjustedPositionRelativeToOffsetParent.
+    return adjustedPositionRelativeToOffsetParent(LayoutPoint()).y();
 }
 
 int RenderBoxModelObject::pixelSnappedOffsetWidth() const

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.h (118960 => 118961)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.h	2012-05-30 20:18:00 UTC (rev 118960)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.h	2012-05-30 20:30:51 UTC (rev 118961)
@@ -225,7 +225,7 @@
         IntSize m_tileSize;
     };
 
-    LayoutPoint offsetTopLeft(const LayoutPoint&) const;
+    LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const;
 
     void calculateBackgroundImageGeometry(const FillLayer*, const LayoutRect& paintRect, BackgroundImageGeometry&);
     void getBorderEdgeInfo(class BorderEdge[], const RenderStyle*, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (118960 => 118961)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2012-05-30 20:18:00 UTC (rev 118960)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2012-05-30 20:30:51 UTC (rev 118961)
@@ -653,7 +653,7 @@
     LayoutPoint topLeft;
     if (InlineBox* firstBox = firstLineBoxIncludingCulling())
         topLeft = flooredLayoutPoint(firstBox->topLeft());
-    return offsetTopLeft(topLeft).x();
+    return adjustedPositionRelativeToOffsetParent(topLeft).x();
 }
 
 LayoutUnit RenderInline::offsetTop() const
@@ -661,7 +661,7 @@
     LayoutPoint topLeft;
     if (InlineBox* firstBox = firstLineBoxIncludingCulling())
         topLeft = flooredLayoutPoint(firstBox->topLeft());
-    return offsetTopLeft(topLeft).y();
+    return adjustedPositionRelativeToOffsetParent(topLeft).y();
 }
 
 static LayoutUnit computeMargin(const RenderInline* renderer, const Length& margin)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to