2006-04-28 Mitz Pettel <opendarwin.org@mitzpettel.com>
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Apr 2006 16:02:45 +0000 (16:02 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Apr 2006 16:02:45 +0000 (16:02 +0000)
        Reviewed by hyatt, landed by ap.

WebCore:
        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6769
          REGRESSION: Incomplete repaint when a cell's extra bottom margin grows

        Test: fast/repaint/table-extra-bottom-grow.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::overflowRect): Changed to not add the top/left overflow twice and
        allow the normal overflow height to overlap with the bottom extra height.
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::layout): Removed the code that resets the extra heights.
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::layoutRows): If the top extra height changed or the
        bottom extra height increased, just repaint the entire cell.

LayoutTests:
        * fast/repaint/table-extra-bottom-grow-expected.checksum: Added.
        * fast/repaint/table-extra-bottom-grow-expected.png: Added.
        * fast/repaint/table-extra-bottom-grow-expected.txt: Added.
        * fast/repaint/table-extra-bottom-grow.html: Added.
        * fast/repaint/table-cell-moved-expected.checksum: Removed excessive painting.
        * fast/repaint/table-cell-moved-expected.png: Ditto.
        * fast/repaint/bugzilla-6278-expected.checksum: Ditto.
        * fast/repaint/bugzilla-6278-expected.png: Ditto.

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

13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/repaint/bugzilla-6278-expected.checksum
LayoutTests/fast/repaint/bugzilla-6278-expected.png
LayoutTests/fast/repaint/table-cell-move-expected.checksum
LayoutTests/fast/repaint/table-cell-move-expected.png
LayoutTests/fast/repaint/table-extra-bottom-grow-expected.checksum [new file with mode: 0644]
LayoutTests/fast/repaint/table-extra-bottom-grow-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/table-extra-bottom-grow-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/table-extra-bottom-grow.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderTableRow.cpp
WebCore/rendering/RenderTableSection.cpp

index 6bf6b6e7871929d1b98bb9ea6667c0ac817f3788..fb9803e45c01aa7730f5b994bcd0e510c1b06a59 100644 (file)
@@ -1,3 +1,19 @@
+2006-04-28  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by hyatt, landed by ap.
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6769
+          REGRESSION: Incomplete repaint when a cell's extra bottom margin grows
+
+        * fast/repaint/table-extra-bottom-grow-expected.checksum: Added.
+        * fast/repaint/table-extra-bottom-grow-expected.png: Added.
+        * fast/repaint/table-extra-bottom-grow-expected.txt: Added.
+        * fast/repaint/table-extra-bottom-grow.html: Added.
+        * fast/repaint/table-cell-moved-expected.checksum: Removed excessive painting.
+        * fast/repaint/table-cell-moved-expected.png: Ditto.
+        * fast/repaint/bugzilla-6278-expected.checksum: Ditto.
+        * fast/repaint/bugzilla-6278-expected.png: Ditto.
+
 2006-04-28  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by andersca.
index e3b2e16070f6e43c1f6a4bf1793589a14929481c..565231751cb81b9501bb20e648bcfb05961d2d38 100644 (file)
@@ -1 +1 @@
-ce744fd2ed7b5cc42549f9f96e207743
\ No newline at end of file
+4714b953a386182e80f2e91dc04a3c11
\ No newline at end of file
index 1c4566552d7308d1595854bf3c3d933725693e7a..b386e6fdc4e65ad0824a21a125a61515e8f022e7 100644 (file)
Binary files a/LayoutTests/fast/repaint/bugzilla-6278-expected.png and b/LayoutTests/fast/repaint/bugzilla-6278-expected.png differ
index bb428ce26a849458bf336b40dac5bfb2354f95bf..104fbf2b514629a9b3a530209dba7a100a7a1cb2 100644 (file)
@@ -1 +1 @@
-01b376508ae26977c599524ce333f0f9
\ No newline at end of file
+2baa577b2d2a75add31a3eb65fa02386
\ No newline at end of file
index b140656efdd362c1cbbe4dd4394879ee8c390053..0b68738dcc973bc274f4b0ce9b433550b6cb8a6f 100644 (file)
Binary files a/LayoutTests/fast/repaint/table-cell-move-expected.png and b/LayoutTests/fast/repaint/table-cell-move-expected.png differ
diff --git a/LayoutTests/fast/repaint/table-extra-bottom-grow-expected.checksum b/LayoutTests/fast/repaint/table-extra-bottom-grow-expected.checksum
new file mode 100644 (file)
index 0000000..fee214c
--- /dev/null
@@ -0,0 +1,2 @@
+504166a83f80f4c2956d16d4b0c60de9
+\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/table-extra-bottom-grow-expected.png b/LayoutTests/fast/repaint/table-extra-bottom-grow-expected.png
new file mode 100644 (file)
index 0000000..6025dc2
Binary files /dev/null and b/LayoutTests/fast/repaint/table-extra-bottom-grow-expected.png differ
diff --git a/LayoutTests/fast/repaint/table-extra-bottom-grow-expected.txt b/LayoutTests/fast/repaint/table-extra-bottom-grow-expected.txt
new file mode 100644 (file)
index 0000000..14e743d
--- /dev/null
@@ -0,0 +1,37 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x238
+  RenderBlock {HTML} at (0,0) size 800x238
+    RenderBody {BODY} at (8,16) size 784x214
+      RenderBlock {P} at (0,0) size 784x18
+        RenderInline {B} at (0,0) size 62x18
+          RenderText {#text} at (0,0) size 62x18
+            text run at (0,0) width 62: "BUG ID:"
+        RenderText {#text} at (62,0) size 4x18
+          text run at (62,0) width 4: " "
+        RenderInline {A} at (0,0) size 117x18 [color=#0000EE]
+          RenderText {#text} at (66,0) size 117x18
+            text run at (66,0) width 117: "Bugzilla bug 6769"
+        RenderText {#text} at (183,0) size 489x18
+          text run at (183,0) width 489: " REGRESSION: Incomplete repaint when a cell's extra bottom margin grows"
+      RenderBlock {P} at (0,34) size 784x24 [bgcolor=#98FB98]
+        RenderInline {B} at (0,0) size 91x18
+          RenderText {#text} at (3,3) size 91x18
+            text run at (3,3) width 91: "TEST PASS:"
+        RenderText {#text} at (94,3) size 355x18
+          text run at (94,3) width 4: " "
+          text run at (98,3) width 351: "There should be only a green square below, and no red."
+      RenderBlock {P} at (0,74) size 784x24 [bgcolor=#FF3300]
+        RenderInline {B} at (0,0) size 90x18
+          RenderText {#text} at (3,3) size 90x18
+            text run at (3,3) width 90: "TEST FAIL:"
+        RenderText {#text} at (93,3) size 311x18
+          text run at (93,3) width 4: " "
+          text run at (97,3) width 307: "The lower-right quarter of the square will be red."
+      RenderTable {TABLE} at (0,114) size 100x100 [bgcolor=#008000]
+        RenderTableSection {TBODY} at (0,0) size 100x100
+          RenderTableRow {TR} at (0,0) size 100x100
+            RenderTableCell {TD} at (0,50) size 50x0 [r=0 c=0 rs=2 cs=1]
+            RenderTableCell {TD} at (50,0) size 50x0 [bgcolor=#008000] [r=0 c=1 rs=1 cs=1]
+          RenderTableRow {TR} at (0,100) size 100x0
+            RenderTableCell {TD} at (50,100) size 50x0 [bgcolor=#FF0000] [r=1 c=1 rs=1 cs=1]
diff --git a/LayoutTests/fast/repaint/table-extra-bottom-grow.html b/LayoutTests/fast/repaint/table-extra-bottom-grow.html
new file mode 100644 (file)
index 0000000..9a3a1f0
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<script src="repaint.js"></script>
+<script>
+    function repaintTest()
+    {
+        document.getElementById("t").style.height='100px';
+        document.getElementById("s").style.height='0';
+    }
+</script>
+</head>
+<body onload="runRepaintTest();">
+<p><b>BUG ID:</b> <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=6769">Bugzilla bug 6769</a> REGRESSION: Incomplete repaint when a cell's extra bottom margin grows</p>
+
+<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
+There should be only a green square below, and no red.
+</p>
+
+<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
+The lower-right quarter of the square will be red.
+</p>
+
+<table style="background: green;" cellspacing="0" cellpadding="0">
+    <tr>
+        <td style="height: 100px; width: 50px;" rowspan="2">
+        </td>
+        <td style="width: 50px; vertical-align: top; background: green; height: 50px;" id="t">
+        </td>
+    </tr>
+    <tr>
+        <td style="background: red;"></td>
+    </tr>
+</table>
+
+</body>
+</html>
+
index f3a9c0b6e204ca3d4e6a5c15195eb97e115b6d17..9ad9fe28365ba7f69fb067c98ee2e201788d7f79 100644 (file)
@@ -1,3 +1,21 @@
+2006-04-28  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by hyatt, landed by ap.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6769
+          REGRESSION: Incomplete repaint when a cell's extra bottom margin grows
+
+        Test: fast/repaint/table-extra-bottom-grow.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::overflowRect): Changed to not add the top/left overflow twice and
+        allow the normal overflow height to overlap with the bottom extra height.
+        * rendering/RenderTableRow.cpp:
+        (WebCore::RenderTableRow::layout): Removed the code that resets the extra heights.
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::layoutRows): If the top extra height changed or the
+        bottom extra height increased, just repaint the entire cell.
+
 2006-04-28  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by andersca.
index 77c5a44dcd43b3e9b6eff01b01ad8e9f7775984b..cb3e64c921fb0cb1537a2a3d18ed2c24193ea849 100644 (file)
@@ -363,7 +363,7 @@ IntRect RenderBlock::overflowRect(bool includeInterior) const
         return borderBox();
     int l = overflowLeft(includeInterior);
     int t = min(overflowTop(includeInterior), -borderTopExtra());
-    return IntRect(l, t, overflowWidth(includeInterior) - 2*l, overflowHeight(includeInterior) + borderTopExtra() + borderBottomExtra() - 2*t);
+    return IntRect(l, t, overflowWidth(includeInterior) - l, max(overflowHeight(includeInterior), height() + borderBottomExtra()) - t);
 }
 
 bool RenderBlock::isSelfCollapsingBlock() const
index 9cc8871e6251b415db66decdd02b5d87c900745b..7cc5cfa1ff1076c28097d08ef0d6995359d47aef 100644 (file)
@@ -111,8 +111,6 @@ void RenderTableRow::layout()
             if (child->needsLayout()) {
                 cell->calcVerticalMargins();
                 cell->layout();
-                cell->setCellTopExtra(0);
-                cell->setCellBottomExtra(0);
             }
         }
     }
index de1dc4bfd02d826165558ff749907246ceb7d3ae..ab4d70af768fb5c08b66dd49c3f9198f0c4405e1 100644 (file)
@@ -488,18 +488,17 @@ int RenderTableSection::layoutRows(int toAdd)
                 }
             }
             if (cellChildrenFlex) {
-                cell->setOverrideSize(max(0, 
-                                           rHeight - cell->borderTop() - cell->paddingTop() - 
-                                                     cell->borderBottom() - cell->paddingBottom()));
-                cell->layoutIfNeeded();
-
                 // Alignment within a cell is based off the calculated
                 // height, which becomes irrelevant once the cell has
                 // been resized based off its percentage. -dwh
                 cell->setCellTopExtra(0);
                 cell->setCellBottomExtra(0);
-            }
-            else {
+
+                cell->setOverrideSize(max(0, 
+                                           rHeight - cell->borderTop() - cell->paddingTop() - 
+                                                     cell->borderBottom() - cell->paddingBottom()));
+                cell->layoutIfNeeded();
+            } else {
                 EVerticalAlign va = cell->style()->verticalAlign();
                 int te = 0;
                 switch (va) {
@@ -523,8 +522,14 @@ int RenderTableSection::layoutRows(int toAdd)
                         break;
                 }
                 
+                int oldTe = cell->borderTopExtra();
+                int oldBe = cell->borderBottomExtra();
+                
+                int be = rHeight - cell->height() - te;
                 cell->setCellTopExtra(te);
-                cell->setCellBottomExtra(rHeight - cell->height() - te);
+                cell->setCellBottomExtra(be);
+                if (!table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout() && (te != oldTe || be > oldBe))
+                    cell->repaint();
             }
             
             int oldCellX = cell->xPos();