[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

hyatt at apple.com hyatt at apple.com
Mon Feb 21 00:39:48 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit fe0c45ea1841788490c0d3d5d465df46438d9100
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 2 20:59:20 2011 +0000

    https://bugs.webkit.org/show_bug.cgi?id=53619
    
    Reviewed by Dan Bernstein.
    
    Floats should not use physical terminology for their rects. Replace left/top with x/y and right/bottom
    with maxX/maxY.  This matches IntRect.
    
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::addOverflowFromFloats):
    (WebCore::RenderBlock::flipFloatForWritingMode):
    (WebCore::RenderBlock::paintFloats):
    (WebCore::RenderBlock::selectionGaps):
    (WebCore::RenderBlock::addOverhangingFloats):
    (WebCore::RenderBlock::addIntrudingFloats):
    (WebCore::RenderBlock::hitTestFloats):
    (WebCore::RenderBlock::adjustForBorderFit):
    * rendering/RenderBlock.h:
    (WebCore::RenderBlock::FloatingObject::x):
    (WebCore::RenderBlock::FloatingObject::maxX):
    (WebCore::RenderBlock::FloatingObject::y):
    (WebCore::RenderBlock::FloatingObject::maxY):
    (WebCore::RenderBlock::FloatingObject::setX):
    (WebCore::RenderBlock::FloatingObject::setY):
    (WebCore::RenderBlock::logicalTopForFloat):
    (WebCore::RenderBlock::logicalBottomForFloat):
    (WebCore::RenderBlock::logicalLeftForFloat):
    (WebCore::RenderBlock::logicalRightForFloat):
    (WebCore::RenderBlock::setLogicalTopForFloat):
    (WebCore::RenderBlock::setLogicalLeftForFloat):
    (WebCore::RenderBlock::xPositionForFloatIncludingMargin):
    (WebCore::RenderBlock::yPositionForFloatIncludingMargin):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77403 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 6cc8dcf..8d3bad6 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,37 @@
+2011-02-02  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=53619
+
+        Floats should not use physical terminology for their rects. Replace left/top with x/y and right/bottom
+        with maxX/maxY.  This matches IntRect.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::addOverflowFromFloats):
+        (WebCore::RenderBlock::flipFloatForWritingMode):
+        (WebCore::RenderBlock::paintFloats):
+        (WebCore::RenderBlock::selectionGaps):
+        (WebCore::RenderBlock::addOverhangingFloats):
+        (WebCore::RenderBlock::addIntrudingFloats):
+        (WebCore::RenderBlock::hitTestFloats):
+        (WebCore::RenderBlock::adjustForBorderFit):
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock::FloatingObject::x):
+        (WebCore::RenderBlock::FloatingObject::maxX):
+        (WebCore::RenderBlock::FloatingObject::y):
+        (WebCore::RenderBlock::FloatingObject::maxY):
+        (WebCore::RenderBlock::FloatingObject::setX):
+        (WebCore::RenderBlock::FloatingObject::setY):
+        (WebCore::RenderBlock::logicalTopForFloat):
+        (WebCore::RenderBlock::logicalBottomForFloat):
+        (WebCore::RenderBlock::logicalLeftForFloat):
+        (WebCore::RenderBlock::logicalRightForFloat):
+        (WebCore::RenderBlock::setLogicalTopForFloat):
+        (WebCore::RenderBlock::setLogicalLeftForFloat):
+        (WebCore::RenderBlock::xPositionForFloatIncludingMargin):
+        (WebCore::RenderBlock::yPositionForFloatIncludingMargin):
+
 2011-02-02  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Update more references to right() and bottom() in Chromium Win.
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index 1609e68..8246de7 100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -1384,7 +1384,7 @@ void RenderBlock::addOverflowFromFloats()
     DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
     for (; (r = it.current()); ++it) {
         if (r->m_isDescendant)
-            addOverflowFromChild(r->m_renderer, IntSize(leftForFloatIncludingMargin(r), topForFloatIncludingMargin(r)));
+            addOverflowFromChild(r->m_renderer, IntSize(xPositionForFloatIncludingMargin(r), yPositionForFloatIncludingMargin(r)));
     }
     return;
 }
@@ -2495,8 +2495,8 @@ IntPoint RenderBlock::flipFloatForWritingMode(const FloatingObject* child, const
     // it's going to get added back in.  We hide this complication here so that the calling code looks normal for the unflipped
     // case.
     if (style()->isHorizontalWritingMode())
-        return IntPoint(point.x(), point.y() + height() - child->renderer()->height() - 2 * topForFloatIncludingMargin(child));
-    return IntPoint(point.x() + width() - child->width() - 2 * leftForFloatIncludingMargin(child), point.y());
+        return IntPoint(point.x(), point.y() + height() - child->renderer()->height() - 2 * yPositionForFloatIncludingMargin(child));
+    return IntPoint(point.x() + width() - child->width() - 2 * xPositionForFloatIncludingMargin(child), point.y());
 }
 
 void RenderBlock::paintFloats(PaintInfo& paintInfo, int tx, int ty, bool preservePhase)
@@ -2511,7 +2511,7 @@ void RenderBlock::paintFloats(PaintInfo& paintInfo, int tx, int ty, bool preserv
         if (r->m_shouldPaint && !r->m_renderer->hasSelfPaintingLayer()) {
             PaintInfo currentPaintInfo(paintInfo);
             currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
-            IntPoint childPoint = flipFloatForWritingMode(r, IntPoint(tx + leftForFloatIncludingMargin(r) - r->m_renderer->x(), ty + topForFloatIncludingMargin(r) - r->m_renderer->y()));
+            IntPoint childPoint = flipFloatForWritingMode(r, IntPoint(tx + xPositionForFloatIncludingMargin(r) - r->m_renderer->x(), ty + yPositionForFloatIncludingMargin(r) - r->m_renderer->y()));
             r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
             if (!preservePhase) {
                 currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
@@ -2745,8 +2745,8 @@ GapRects RenderBlock::selectionGaps(RenderBlock* rootBlock, const IntPoint& root
         if (m_floatingObjects) {
             for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); it.current(); ++it) {
                 FloatingObject* r = it.current();
-                IntRect floatBox = IntRect(offsetFromRootBlock.width() + leftForFloatIncludingMargin(r),
-                                           offsetFromRootBlock.height() + topForFloatIncludingMargin(r),
+                IntRect floatBox = IntRect(offsetFromRootBlock.width() + xPositionForFloatIncludingMargin(r),
+                                           offsetFromRootBlock.height() + yPositionForFloatIncludingMargin(r),
                                            r->m_renderer->width(), r->m_renderer->height());
                 rootBlock->flipForWritingMode(floatBox);
                 floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y());
@@ -3599,7 +3599,7 @@ int RenderBlock::addOverhangingFloats(RenderBlock* child, int logicalLeftOffset,
             if (!containsFloat(r->m_renderer)) {
                 int leftOffset = style()->isHorizontalWritingMode() ? logicalLeftOffset : logicalTopOffset;
                 int topOffset = style()->isHorizontalWritingMode() ? logicalTopOffset : logicalLeftOffset;
-                FloatingObject* floatingObj = new FloatingObject(r->type(), IntRect(r->left() - leftOffset, r->top() - topOffset, r->width(), r->height()));
+                FloatingObject* floatingObj = new FloatingObject(r->type(), IntRect(r->x() - leftOffset, r->y() - topOffset, r->width(), r->height()));
                 floatingObj->m_renderer = r->m_renderer;
 
                 // The nearest enclosing layer always paints the float (so that zindex and stacking
@@ -3634,7 +3634,7 @@ int RenderBlock::addOverhangingFloats(RenderBlock* child, int logicalLeftOffset,
             // Since the float doesn't overhang, it didn't get put into our list.  We need to go ahead and add its overflow in to the
             // child now.
             if (r->m_isDescendant)
-                child->addOverflowFromChild(r->m_renderer, IntSize(leftForFloatIncludingMargin(r), topForFloatIncludingMargin(r)));
+                child->addOverflowFromChild(r->m_renderer, IntSize(xPositionForFloatIncludingMargin(r), yPositionForFloatIncludingMargin(r)));
         }
     }
     return lowestFloatLogicalBottom;
@@ -3666,7 +3666,7 @@ void RenderBlock::addIntrudingFloats(RenderBlock* prev, int logicalLeftOffset, i
                 int leftOffset = style()->isHorizontalWritingMode() ? logicalLeftOffset : logicalTopOffset;
                 int topOffset = style()->isHorizontalWritingMode() ? logicalTopOffset : logicalLeftOffset;
                 
-                FloatingObject* floatingObj = new FloatingObject(r->type(), IntRect(r->left() - leftOffset, r->top() - topOffset, r->width(), r->height()));
+                FloatingObject* floatingObj = new FloatingObject(r->type(), IntRect(r->x() - leftOffset, r->y() - topOffset, r->width(), r->height()));
 
                 // Applying the child's margin makes no sense in the case where the child was passed in.
                 // since this margin was added already through the modification of the |logicalLeftOffset| variable
@@ -3675,9 +3675,9 @@ void RenderBlock::addIntrudingFloats(RenderBlock* prev, int logicalLeftOffset, i
                 // will get applied twice.
                 if (prev != parent()) {
                     if (style()->isHorizontalWritingMode())
-                        floatingObj->setLeft(floatingObj->left() + prev->marginLeft());
+                        floatingObj->setX(floatingObj->x() + prev->marginLeft());
                     else
-                        floatingObj->setTop(floatingObj->top() + prev->marginTop());
+                        floatingObj->setY(floatingObj->y() + prev->marginTop());
                 }
                
                 floatingObj->m_shouldPaint = false;  // We are not in the direct inheritance chain for this float. We will never paint it.
@@ -3872,8 +3872,8 @@ bool RenderBlock::hitTestFloats(const HitTestRequest& request, HitTestResult& re
     DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
     for (it.toLast(); (floatingObject = it.current()); --it) {
         if (floatingObject->m_shouldPaint && !floatingObject->m_renderer->hasSelfPaintingLayer()) {
-            int xOffset = leftForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->x();
-            int yOffset = topForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->y();
+            int xOffset = xPositionForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->x();
+            int yOffset = yPositionForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->y();
             IntPoint childPoint = flipFloatForWritingMode(floatingObject, IntPoint(tx + xOffset, ty + yOffset));
             if (floatingObject->m_renderer->hitTest(request, result, IntPoint(x, y), childPoint.x(), childPoint.y())) {
                 updateHitTestResult(result, IntPoint(x - childPoint.x(), y - childPoint.y()));
@@ -5482,7 +5482,7 @@ void RenderBlock::adjustForBorderFit(int x, int& left, int& right) const
             for (; (r = it.current()); ++it) {
                 // Only examine the object if our m_shouldPaint flag is set.
                 if (r->m_shouldPaint) {
-                    int floatLeft = leftForFloatIncludingMargin(r) - r->m_renderer->x();
+                    int floatLeft = xPositionForFloatIncludingMargin(r) - r->m_renderer->x();
                     int floatRight = floatLeft + r->m_renderer->width();
                     left = min(left, floatLeft);
                     right = max(right, floatRight);
diff --git a/Source/WebCore/rendering/RenderBlock.h b/Source/WebCore/rendering/RenderBlock.h
index 25ec37a..2c61331 100644
--- a/Source/WebCore/rendering/RenderBlock.h
+++ b/Source/WebCore/rendering/RenderBlock.h
@@ -397,15 +397,15 @@ private:
         bool isPlaced() const { return m_isPlaced; }
         void setIsPlaced(bool placed = true) { m_isPlaced = placed; }
 
-        int left() const { ASSERT(isPlaced()); return m_frameRect.x(); }
-        int right() const { ASSERT(isPlaced()); return m_frameRect.maxX(); }
-        int top() const { ASSERT(isPlaced()); return m_frameRect.y(); }
-        int bottom() const { ASSERT(isPlaced()); return m_frameRect.maxY(); }
+        int x() const { ASSERT(isPlaced()); return m_frameRect.x(); }
+        int maxX() const { ASSERT(isPlaced()); return m_frameRect.maxX(); }
+        int y() const { ASSERT(isPlaced()); return m_frameRect.y(); }
+        int maxY() const { ASSERT(isPlaced()); return m_frameRect.maxY(); }
         int width() const { return m_frameRect.width(); }
         int height() const { return m_frameRect.height(); }
 
-        void setLeft(int left) { m_frameRect.setX(left); }
-        void setTop(int top) { m_frameRect.setY(top); }
+        void setX(int x) { m_frameRect.setX(x); }
+        void setY(int y) { m_frameRect.setY(y); }
         void setWidth(int width) { m_frameRect.setWidth(width); }
         void setHeight(int height) { m_frameRect.setHeight(height); }
 
@@ -423,24 +423,24 @@ private:
 
     IntPoint flipFloatForWritingMode(const FloatingObject*, const IntPoint&) const;
 
-    int logicalTopForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->top() : child->left(); }
-    int logicalBottomForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->bottom() : child->right(); }
-    int logicalLeftForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->left() : child->top(); }
-    int logicalRightForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->right() : child->bottom(); }
+    int logicalTopForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->y() : child->x(); }
+    int logicalBottomForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->maxY() : child->maxX(); }
+    int logicalLeftForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->x() : child->y(); }
+    int logicalRightForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->maxX() : child->maxY(); }
     int logicalWidthForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->width() : child->height(); }
     void setLogicalTopForFloat(FloatingObject* child, int logicalTop)
     {
         if (style()->isHorizontalWritingMode())
-            child->setTop(logicalTop);
+            child->setY(logicalTop);
         else
-            child->setLeft(logicalTop);
+            child->setX(logicalTop);
     }
     void setLogicalLeftForFloat(FloatingObject* child, int logicalLeft)
     {
         if (style()->isHorizontalWritingMode())
-            child->setLeft(logicalLeft);
+            child->setX(logicalLeft);
         else
-            child->setTop(logicalLeft);
+            child->setY(logicalLeft);
     }
     void setLogicalHeightForFloat(FloatingObject* child, int logicalHeight)
     {
@@ -457,20 +457,20 @@ private:
             child->setHeight(logicalWidth);
     }
 
-    int leftForFloatIncludingMargin(const FloatingObject* child) const
+    int xPositionForFloatIncludingMargin(const FloatingObject* child) const
     {
         if (style()->isHorizontalWritingMode())
-            return child->left() + child->renderer()->marginLeft();
+            return child->x() + child->renderer()->marginLeft();
         else
-            return child->left() + marginBeforeForChild(child->renderer());
+            return child->x() + marginBeforeForChild(child->renderer());
     }
         
-    int topForFloatIncludingMargin(const FloatingObject* child) const
+    int yPositionForFloatIncludingMargin(const FloatingObject* child) const
     {
         if (style()->isHorizontalWritingMode())
-            return child->top() + marginBeforeForChild(child->renderer());
+            return child->y() + marginBeforeForChild(child->renderer());
         else
-            return child->top() + child->renderer()->marginTop();
+            return child->y() + child->renderer()->marginTop();
     }
 
     // The following functions' implementations are in RenderBlockLineLayout.cpp.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list