Fix by Mitz Pettel, reviewed by Darin, committed by ap.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2006 10:57:58 +0000 (10:57 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2006 10:57:58 +0000 (10:57 +0000)
        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6278
          REGRESSION: Incomplete repaint when table cell width changes during layout

        * manual-tests/bugzilla-6278.html: Added.
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::setCellWidths): If during layout a cell changes from
        not needing layout to needing layout, call repaintObjectsBeforeLayout on it.

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

WebCore/ChangeLog
WebCore/manual-tests/bugzilla-6278.html [new file with mode: 0644]
WebCore/rendering/RenderTableSection.cpp

index 1d893473931240e96ad3e66fa9d86b09d4342639..ff7cc4d01d5760d98b698fbd0ff90e279ba5a325 100644 (file)
@@ -1,3 +1,15 @@
+2006-01-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin, committed by ap.
+        
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6278
+          REGRESSION: Incomplete repaint when table cell width changes during layout
+
+        * manual-tests/bugzilla-6278.html: Added.
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::setCellWidths): If during layout a cell changes from
+        not needing layout to needing layout, call repaintObjectsBeforeLayout on it.
+
 2006-01-26  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by mjs.
diff --git a/WebCore/manual-tests/bugzilla-6278.html b/WebCore/manual-tests/bugzilla-6278.html
new file mode 100644 (file)
index 0000000..dc90084
--- /dev/null
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+</head>
+<body>
+<p><b>BUG ID:</b> <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=6278">Bugzilla bug 6278</a> REGRESSION: Incomplete repaint when table cell width changes during layout</p>
+
+<p id="test" style="background-color:skyblue; padding:3px;"><b>STEPS TO TEST:</b> 
+Click the Test button below.
+</p>
+
+<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
+The purple and green rects will resize, and there will remain separated by a blue horizontal line.
+</p>
+
+<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
+The purple and green rects will resize, but the blue separator will disappear.
+</p>
+<button onclick="document.getElementById('target').style.width='50px'">Test</button>
+<table style="width: 300px;">
+<tr>
+    <td id="col1" style="background: blue; padding:0;">
+        <div style="background: #eeeeff;">
+            Curabitur pretium, quam quis semper malesuada, est libero feugiat libero, vel fringilla orci nibh sed neque. Quisque eu nulla non nisi molestie accumsan. Etiam tellus urna, laoreet ac, laoreet non, suscipit sed, sapien. Phasellus vehicula, sem at posuere vehicula, augue nibh molestie nisl, nec ullamcorper lacus ante vulputate pede.
+        </div>
+        <div style="background: #eeffee; margin-top: 5px; height: 50px;">
+        </div>
+    </td>
+    <td id="target"></td>
+</tr>
+</table>
+
+</body>
+</html>
index ddda68533d7f3d484033d85882b7eed00457196e..8266cc2372cc8f84783899826d724289b97cc8e3 100644 (file)
@@ -254,7 +254,10 @@ void RenderTableSection::setCellWidths()
             int w = columnPos[endCol] - columnPos[j] - table()->hBorderSpacing();
             int oldWidth = cell->width();
             if (w != oldWidth) {
+                bool neededLayout = cell->selfNeedsLayout();
                 cell->setNeedsLayout(true);
+                if (!neededLayout && !selfNeedsLayout() && cell->checkForRepaintDuringLayout())
+                    cell->repaintObjectsBeforeLayout();
                 cell->setWidth(w);
             }
         }