RenderBlock::addOverhangingFloats() takes superfluous parameters
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Sep 2011 22:08:52 +0000 (22:08 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Sep 2011 22:08:52 +0000 (22:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=67863

Reviewed by Dave Hyatt.

No new tests, because behavior is unchanged.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlock):
(WebCore::RenderBlock::layoutBlockChild):
(WebCore::RenderBlock::addOverhangingFloats): Removed the logical{Left, Top}Offset parameters,
since they were always the inverse of the logical{Left, Top}() of the child parameter.
* rendering/RenderBlock.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94877 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h

index 7fbd163afd447ddd54f0fa8595e657d2f918af6b..af771788d1150af2f78b2f5fcea9b2333558b2c6 100644 (file)
@@ -1,3 +1,19 @@
+2011-09-09  Dan Bernstein  <mitz@apple.com>
+
+        RenderBlock::addOverhangingFloats() takes superfluous parameters
+        https://bugs.webkit.org/show_bug.cgi?id=67863
+
+        Reviewed by Dave Hyatt.
+
+        No new tests, because behavior is unchanged.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutBlock):
+        (WebCore::RenderBlock::layoutBlockChild):
+        (WebCore::RenderBlock::addOverhangingFloats): Removed the logical{Left, Top}Offset parameters,
+        since they were always the inverse of the logical{Left, Top}() of the child parameter.
+        * rendering/RenderBlock.h:
+
 2011-09-09  Rafael Antognolli  <antognolli@profusion.mobi>
 
         Add replacement functions for gdk ones.
index adff7309e8bd95e453004d0c79059d9859b3cdcf..af1750ed215c383b4ca729e1ba03e1d3f182695e 100644 (file)
@@ -1295,7 +1295,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
                 if (child->isBlockFlow() && !child->isFloatingOrPositioned()) {
                     RenderBlock* block = toRenderBlock(child);
                     if (block->lowestFloatLogicalBottomIncludingPositionedFloats() + block->logicalTop() > newHeight)
-                        addOverhangingFloats(block, -block->logicalLeft(), -block->logicalTop(), false);
+                        addOverhangingFloats(block, false);
                 }
             }
         }
@@ -2105,7 +2105,7 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, Lay
     // If the child has overhanging floats that intrude into following siblings (or possibly out
     // of this block), then the parent gets notified of the floats now.
     if (childRenderBlock && childRenderBlock->containsFloats())
-        maxFloatLogicalBottom = max(maxFloatLogicalBottom, addOverhangingFloats(toRenderBlock(child), -child->logicalLeft(), -child->logicalTop(), !childNeededLayout));
+        maxFloatLogicalBottom = max(maxFloatLogicalBottom, addOverhangingFloats(toRenderBlock(child), !childNeededLayout));
 
     LayoutSize childOffset(child->x() - oldRect.x(), child->y() - oldRect.y());
     if (childOffset.width() || childOffset.height()) {
@@ -3809,13 +3809,14 @@ void RenderBlock::clearFloats(BlockLayoutPass layoutPass)
     }
 }
 
-LayoutUnit RenderBlock::addOverhangingFloats(RenderBlock* child, LayoutUnit logicalLeftOffset, LayoutUnit logicalTopOffset, bool makeChildPaintOtherFloats)
+LayoutUnit RenderBlock::addOverhangingFloats(RenderBlock* child, bool makeChildPaintOtherFloats)
 {
     // Prevent floats from being added to the canvas by the root element, e.g., <html>.
     if (child->hasOverflowClip() || !child->containsFloats() || child->isRoot() || child->hasColumns() || child->isWritingModeRoot())
         return 0;
 
     LayoutUnit childLogicalTop = child->logicalTop();
+    LayoutUnit childLogicalLeft = child->logicalLeft();
     LayoutUnit lowestFloatLogicalBottom = 0;
 
     // Floats that will remain the child's responsibility to paint should factor into its
@@ -3830,8 +3831,8 @@ LayoutUnit RenderBlock::addOverhangingFloats(RenderBlock* child, LayoutUnit logi
         if (logicalBottom > logicalHeight()) {
             // If the object is not in the list, we add it now.
             if (!containsFloat(r->m_renderer)) {
-                LayoutUnit leftOffset = isHorizontalWritingMode() ? logicalLeftOffset : logicalTopOffset;
-                LayoutUnit topOffset = isHorizontalWritingMode() ? logicalTopOffset : logicalLeftOffset;
+                LayoutUnit leftOffset = isHorizontalWritingMode() ? -childLogicalLeft : -childLogicalTop;
+                LayoutUnit topOffset = isHorizontalWritingMode() ? -childLogicalTop : -childLogicalLeft;
                 FloatingObject* floatingObj = new FloatingObject(r->type(), LayoutRect(r->x() - leftOffset, r->y() - topOffset, r->width(), r->height()));
                 floatingObj->m_renderer = r->m_renderer;
 
index 2a8d653c7be8f02bfb83ecf7e95f2a11a40d9936..d23b04924e0b1f92da7acda529d6ef79010375a6 100644 (file)
@@ -631,7 +631,7 @@ private:
     bool hasOverhangingFloats() { return parent() && !hasColumns() && containsFloats() && lowestFloatLogicalBottomIncludingPositionedFloats() > logicalHeight(); }
     bool hasOverhangingFloat(RenderBox*);
     void addIntrudingFloats(RenderBlock* prev, LayoutUnit xoffset, LayoutUnit yoffset);
-    LayoutUnit addOverhangingFloats(RenderBlock* child, LayoutUnit xoffset, LayoutUnit yoffset, bool makeChildPaintOtherFloats);
+    LayoutUnit addOverhangingFloats(RenderBlock* child, bool makeChildPaintOtherFloats);
 
     LayoutUnit lowestFloatLogicalBottom() const { return lowestFloatLogicalBottom(FloatingObject::FloatLeftRight); }
     LayoutUnit lowestFloatLogicalBottomIncludingPositionedFloats() const { return lowestFloatLogicalBottom(FloatingObject::FloatAll); }