2007-04-17 Mitz Pettel <mitz@webkit.org>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2007 04:58:54 +0000 (04:58 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2007 04:58:54 +0000 (04:58 +0000)
        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=13369
          REGRESSION (r13366): Invisible table cell background is painted

        Test: fast/table/invisible-cell-background.html

        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::paintBackgroundsBehindCell): Don't paint any
        background if the cell is not visible. This behavior matches WinIE and Opera.

2007-04-17  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Darin.

        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=13369
          REGRESSION (r13366): Invisible table cell background is painted

        * fast/table/invisible-cell-background-expected.checksum: Added.
        * fast/table/invisible-cell-background-expected.png: Added.
        * fast/table/invisible-cell-background-expected.txt: Added.
        * fast/table/invisible-cell-background.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/table/invisible-cell-background-expected.checksum [new file with mode: 0644]
LayoutTests/fast/table/invisible-cell-background-expected.png [new file with mode: 0644]
LayoutTests/fast/table/invisible-cell-background-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/invisible-cell-background.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderTableCell.cpp

index 0eb6f4b..fee2ba6 100644 (file)
@@ -1,3 +1,15 @@
+2007-04-17  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=13369
+          REGRESSION (r13366): Invisible table cell background is painted
+
+        * fast/table/invisible-cell-background-expected.checksum: Added.
+        * fast/table/invisible-cell-background-expected.png: Added.
+        * fast/table/invisible-cell-background-expected.txt: Added.
+        * fast/table/invisible-cell-background.html: Added.
+
 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
diff --git a/LayoutTests/fast/table/invisible-cell-background-expected.checksum b/LayoutTests/fast/table/invisible-cell-background-expected.checksum
new file mode 100644 (file)
index 0000000..3f1a9ff
--- /dev/null
@@ -0,0 +1 @@
+54e7e66d79dbf02e9b4e7b6b9e778e98
\ No newline at end of file
diff --git a/LayoutTests/fast/table/invisible-cell-background-expected.png b/LayoutTests/fast/table/invisible-cell-background-expected.png
new file mode 100644 (file)
index 0000000..1099027
Binary files /dev/null and b/LayoutTests/fast/table/invisible-cell-background-expected.png differ
diff --git a/LayoutTests/fast/table/invisible-cell-background-expected.txt b/LayoutTests/fast/table/invisible-cell-background-expected.txt
new file mode 100644 (file)
index 0000000..1971706
--- /dev/null
@@ -0,0 +1,56 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 312x18
+          text run at (0,0) width 312: "This tests that the background of a table cell with "
+        RenderInline {TT} at (0,0) size 136x15
+          RenderText {#text} at (312,2) size 136x15
+            text run at (312,2) width 136: "visibility:hidden"
+        RenderText {#text} at (448,0) size 107x18
+          text run at (448,0) width 107: " is never painted."
+      RenderBlock {P} at (0,34) size 784x18
+        RenderText {#text} at (0,0) size 460x18
+          text run at (0,0) width 460: "You should see nine green squares and no red, orange or yellow squares."
+      RenderTable {TABLE} at (4,68) size 27x25
+        RenderTableSection {TBODY} at (0,0) size 27x25 [bgcolor=#FFFF00]
+          RenderTableRow {TR} at (0,0) size 27x25 [bgcolor=#FFA500]
+            RenderTableCell {TD} at (0,11) size 27x2 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
+      RenderTable {TABLE} at (4,97) size 27x25 [bgcolor=#FF0000]
+        RenderTableSection {TBODY} at (0,0) size 27x25 [bgcolor=#FFFF00]
+          RenderTableRow {TR} at (0,0) size 27x25 [bgcolor=#FFA500]
+            RenderTableCell {TD} at (0,11) size 27x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+      RenderTable {TABLE} at (4,126) size 27x25 [bgcolor=#FF0000]
+        RenderTableSection {TBODY} at (0,0) size 27x25 [bgcolor=#FFFF00]
+          RenderTableRow {TR} at (0,0) size 27x25 [bgcolor=#FFA500]
+            RenderTableCell {TD} at (0,11) size 27x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+      RenderTable {TABLE} at (4,155) size 27x25 [bgcolor=#FF0000]
+        RenderTableSection {TBODY} at (0,0) size 27x25 [bgcolor=#FFFF00]
+          RenderTableRow {TR} at (0,0) size 27x25 [bgcolor=#FFA500]
+            RenderTableCell {TD} at (0,11) size 27x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+      RenderTable {TABLE} at (4,184) size 27x25 [bgcolor=#008000]
+        RenderTableSection {TBODY} at (0,0) size 27x25 [bgcolor=#FF0000]
+          RenderTableRow {TR} at (0,0) size 27x25 [bgcolor=#FFA500]
+            RenderTableCell {TD} at (0,11) size 27x2 [r=0 c=0 rs=1 cs=1]
+      RenderTable {TABLE} at (4,213) size 27x25 [bgcolor=#FF0000]
+        RenderTableSection {TBODY} at (0,0) size 27x25 [bgcolor=#FFFF00]
+          RenderTableRow {TR} at (0,0) size 27x25 [bgcolor=#FFA500]
+            RenderTableCell {TD} at (0,11) size 27x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+      RenderTable {TABLE} at (4,242) size 27x25 [bgcolor=#FF0000]
+        RenderTableSection {TBODY} at (0,0) size 27x25 [bgcolor=#FFFF00]
+          RenderTableRow {TR} at (0,0) size 27x25 [bgcolor=#FFA500]
+            RenderTableCell {TD} at (0,11) size 27x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+      RenderTable {TABLE} at (4,271) size 27x25 [bgcolor=#008000]
+        RenderTableSection {TBODY} at (0,0) size 27x25 [bgcolor=#FFFF00]
+          RenderTableRow {TR} at (0,0) size 27x25 [bgcolor=#FFA500]
+            RenderTableCell {TD} at (0,11) size 27x2 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
+      RenderTable {TABLE} at (4,300) size 27x25 [bgcolor=#FF0000]
+        RenderTableSection {TBODY} at (0,0) size 27x25 [bgcolor=#FFFF00]
+          RenderTableRow {TR} at (0,0) size 27x25 [bgcolor=#FFA500]
+            RenderTableCell {TD} at (0,11) size 27x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+      RenderTable {TABLE} at (4,329) size 27x25 [bgcolor=#008000]
+        RenderTableSection {TBODY} at (0,0) size 27x25 [bgcolor=#FFFF00]
+          RenderTableRow {TR} at (0,0) size 27x25 [bgcolor=#FFA500]
+            RenderTableCell {TD} at (0,11) size 27x2 [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
diff --git a/LayoutTests/fast/table/invisible-cell-background.html b/LayoutTests/fast/table/invisible-cell-background.html
new file mode 100644 (file)
index 0000000..5643b19
--- /dev/null
@@ -0,0 +1,100 @@
+<html>
+<head>
+    <title></title>
+    <style>
+        table { margin: 4px; border-collapse: collapse; }
+        tbody { background-color: yellow; }
+        tr { background-color: orange; }
+        td { width: 25px; height: 25px; }
+        .green { background-color: green; }
+        .red { background-color: red; }
+    </style>
+</head>
+<body>
+<p>
+    This tests that the background of a table cell with <tt>visibility:hidden</tt> is never painted.
+</p>
+<p>
+    You should see nine green squares and no red, orange or yellow squares.
+</p>
+<table style="visibility: hidden;">
+    <tbody>
+        <tr>
+            <td class="red"></td>
+        </tr>
+    </tbody>
+</table>
+
+<table style="visibility: hidden;" class="red">
+    <tbody style="visibility: visible;">
+        <tr>
+            <td class="green"></td>
+        </tr>
+    </tbody>
+</table>
+
+<table style="visibility: hidden;" class="red">
+    <tbody>
+        <tr style="visibility: visible;">
+            <td class="green"></td>
+        </tr>
+    </tbody>
+</table>
+
+<table style="visibility: hidden;" class="red">
+    <tbody>
+        <tr>
+            <td style="visibility: visible;" class="green"></td>
+        </tr>
+    </tbody>
+</table>
+
+<table class="green">
+    <tbody style="visibility: hidden;" class="red">
+        <tr>
+            <td></td>
+        </tr>
+    </tbody>
+</table>
+
+<table class="red">
+    <tbody style="visibility: hidden;">
+        <tr style="visibility: visible;">
+            <td class="green"></td>
+        </tr>
+    </tbody>
+</table>
+
+<table class="red">
+    <tbody style="visibility: hidden;">
+        <tr>
+            <td style="visibility: visible;" class="green"></td>
+        </tr>
+    </tbody>
+</table>
+
+<table class="green">
+    <tbody>
+        <tr style="visibility: hidden;">
+            <td class="red"></td>
+        </tr>
+    </tbody>
+</table>
+
+<table class="red">
+    <tbody>
+        <tr style="visibility: hidden;">
+            <td style="visibility: visible;" class="green"></td>
+        </tr>
+    </tbody>
+</table>
+
+<table class="green">
+    <tbody>
+        <tr>
+            <td style="visibility: hidden;" class="red"></td>
+        </tr>
+    </tbody>
+</table>
+</body>
+</html>
index 1f07925..5e59518 100644 (file)
@@ -1,3 +1,16 @@
+2007-04-17  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=13369
+          REGRESSION (r13366): Invisible table cell background is painted
+
+        Test: fast/table/invisible-cell-background.html
+
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::paintBackgroundsBehindCell): Don't paint any
+        background if the cell is not visible. This behavior matches WinIE and Opera.
+
 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
index 1c5d1e5..3b664e2 100644 (file)
@@ -759,6 +759,9 @@ void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, int tx, i
     if (!backgroundObject)
         return;
 
+    if (style()->visibility() != VISIBLE)
+        return;
+
     RenderTable* tableElt = table();
     if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstChild())
         return;