Reviewed by Darin.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Jan 2006 04:28:19 +0000 (04:28 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Jan 2006 04:28:19 +0000 (04:28 +0000)
        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3509
          REGRESSION(125-412) Portion of nested table is not painted correctly on cafepress site

        * manual-tests/bugzilla-3509.html: Added.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::layoutBlockChildren): Force repaint if the child didn't move but
        didn't repaint correctly during layout because it was not at its final position then.

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

WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp

index 9e5b727..8dee72a 100644 (file)
@@ -1,3 +1,15 @@
+2006-01-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin.
+        
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3509
+          REGRESSION(125-412) Portion of nested table is not painted correctly on cafepress site
+
+        * manual-tests/bugzilla-3509.html: Added.
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutBlockChildren): Force repaint if the child didn't move but
+        didn't repaint correctly during layout because it was not at its final position then.
+
 2006-01-21  Anders Carlsson  <andersca@mac.com>
 
         Reviewed by Darin.
index dfadc1c..bd6d6f8 100644 (file)
@@ -1063,6 +1063,7 @@ void RenderBlock::layoutBlockChildren(bool relayoutChildren)
         // Now determine the correct ypos based off examination of collapsing margin
         // values.
         collapseMargins(child, marginInfo, yPosEstimate);
+        int postCollapseChildY = child->yPos();
 
         // Now check for clear.
         clearFloatsIfNeeded(child, marginInfo, oldTopPosMargin, oldTopNegMargin);
@@ -1103,8 +1104,18 @@ void RenderBlock::layoutBlockChildren(bool relayoutChildren)
         // If the child moved, we have to repaint it as well as any floating/positioned
         // descendants.  An exception is if we need a layout.  In this case, we know we're going to
         // repaint ourselves (and the child) anyway.
-        if (!selfNeedsLayout() && child->checkForRepaintDuringLayout())
-            child->repaintDuringLayoutIfMoved(oldChildX, oldChildY);
+        if (!selfNeedsLayout() && child->checkForRepaintDuringLayout()) {
+            int finalChildX = child->xPos();
+            int finalChildY = child->yPos();
+            if (finalChildX != oldChildX || finalChildY != oldChildY)
+                child->repaintDuringLayoutIfMoved(oldChildX, oldChildY);
+            else if (finalChildY != yPosEstimate || finalChildY != postCollapseChildY) {
+                // The child's repaints during layout were done before it reached its final position,
+                // so they were wrong.
+                child->repaint();
+                child->repaintFloatingDescendants();
+            }
+        }
 
         child = child->nextSibling();
     }