Fix for 3892686, left/top overflow was not being propagated properly up to containin...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Dec 2004 03:05:50 +0000 (03:05 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Dec 2004 03:05:50 +0000 (03:05 +0000)
error.

Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
all inlines when repainting.

        Reviewed by rjw

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::getAbsoluteRepaintRect):

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_block.cpp
WebCore/khtml/rendering/render_flow.cpp

index b3680d974712c48daeefa2b48e8bed09e6ea86bd..9b1da60cab38cb5f216efe453e3c8c2b9eab667f 100644 (file)
@@ -1,3 +1,18 @@
+2004-12-09  David Hyatt  <hyatt@apple.com>
+
+       Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
+       error.
+
+       Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
+       all inlines when repainting.
+       
+        Reviewed by rjw
+
+        * khtml/rendering/render_block.cpp:
+        (khtml::RenderBlock::layoutBlockChildren):
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::getAbsoluteRepaintRect):
+
 2004-12-09  David Hyatt  <hyatt@apple.com>
 
        Fix for 3867545, finance.yahoo.com lays out incorrectly.  Add a quirk that will prevent tables from moving
index 531c4a63eea4fc3355dbc197c28d6a75c3c6ef96..62fff3b1e391327190e069b0e1b0eb739e093210 100644 (file)
@@ -1078,7 +1078,7 @@ void RenderBlock::layoutBlockChildren(bool relayoutChildren)
         determineHorizontalPosition(child);
 
         // Update our top overflow in case the child spills out the top of the block.
-        m_overflowTop = kMin(m_overflowTop, child->yPos() - child->overflowTop(false));
+        m_overflowTop = kMin(m_overflowTop, child->yPos() + child->overflowTop(false));
         
         // Update our height now that the child has been placed in the correct position.
         m_height += child->height();
@@ -1098,7 +1098,7 @@ void RenderBlock::layoutBlockChildren(bool relayoutChildren)
         // See if this child has made our overflow need to grow.
         int rightChildPos = child->xPos() + kMax(child->overflowWidth(false), child->width());
         m_overflowWidth = kMax(rightChildPos, m_overflowWidth);
-        m_overflowLeft = kMin(child->xPos() - child->overflowLeft(false), m_overflowLeft);
+        m_overflowLeft = kMin(child->xPos() + child->overflowLeft(false), m_overflowLeft);
         
         // Insert our compact into the block margin if we have one.
         insertCompactIfNeeded(child, compactInfo);
index e8c783836f94b2cd812f3ffb08a8623cc1310d06..085d157e9fa0c045c253f34b9adb12cbfa50cdee 100644 (file)
@@ -455,11 +455,17 @@ QRect RenderFlow::getAbsoluteRepaintRect()
         int ow = style() ? style()->outlineSize() : 0;
         if (isCompact())
             left -= m_x;
-        if (style()->position() == RELATIVE && m_layer)
-            m_layer->relativePositionOffset(left, top);
+        
+        // We need to add in the relative position offsets of any inlines (including us) up to our
+        // containing block.
+        RenderBlock* cb = containingBlock();
+        for (RenderObject* inlineFlow = this; inlineFlow && inlineFlow->isInlineFlow() && inlineFlow != cb; 
+             inlineFlow = inlineFlow->parent()) {
+             if (inlineFlow->style()->position() == RELATIVE && inlineFlow->layer())
+                inlineFlow->layer()->relativePositionOffset(left, top);
+        }
 
         QRect r(-ow+left, -ow+top, width()+ow*2, height()+ow*2);
-        RenderBlock* cb = containingBlock();
         if (cb->hasOverflowClip()) {
             // cb->height() is inaccurate if we're in the middle of a layout of |cb|, so use the
             // layer's size instead.  Even if the layer's size is wrong, the layer itself will repaint
@@ -471,7 +477,6 @@ QRect RenderFlow::getAbsoluteRepaintRect()
             QRect repaintRect(x, y, r.width(), r.height());
             r = repaintRect.intersect(boxRect);
         }
-
         cb->computeAbsoluteRepaintRect(r);
         
         if (ow) {