LayoutTests:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Feb 2007 03:01:04 +0000 (03:01 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Feb 2007 03:01:04 +0000 (03:01 +0000)
        Reviewed by Hyatt.

        - repaint test for http://bugs.webkit.org/show_bug.cgi?id=12817
          REGRESSION (r18634): Table border-collapse problems with right margin

        * fast/repaint/table-outer-border-expected.checksum: Added.
        * fast/repaint/table-outer-border-expected.png: Added.
        * fast/repaint/table-outer-border-expected.txt: Added.
        * fast/repaint/table-outer-border.html: Added.

WebCore:

        Reviewed by Hyatt.

        - fix http://bugs.webkit.org/show_bug.cgi?id=12817
          REGRESSION (r18634): Table border-collapse problems with right margin

        Test: fast/repaint/table-outer-border.html

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::layout): Reordered to initialize horizontal overflow
        after table sections have computed their outer horizontal borders.

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

LayoutTests/ChangeLog
LayoutTests/fast/repaint/table-outer-border-expected.checksum [new file with mode: 0644]
LayoutTests/fast/repaint/table-outer-border-expected.png [new file with mode: 0644]
LayoutTests/fast/repaint/table-outer-border-expected.txt [new file with mode: 0644]
LayoutTests/fast/repaint/table-outer-border.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderTable.cpp

index b6b53e2..a8fbc7b 100644 (file)
@@ -1,3 +1,15 @@
+2007-02-19  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Hyatt.
+
+        - repaint test for http://bugs.webkit.org/show_bug.cgi?id=12817
+          REGRESSION (r18634): Table border-collapse problems with right margin
+
+        * fast/repaint/table-outer-border-expected.checksum: Added.
+        * fast/repaint/table-outer-border-expected.png: Added.
+        * fast/repaint/table-outer-border-expected.txt: Added.
+        * fast/repaint/table-outer-border.html: Added.
+
 2007-02-19  Zalan Bujtas  <zbujtas@gmail.com>
 
         Reviewed by Darin.
diff --git a/LayoutTests/fast/repaint/table-outer-border-expected.checksum b/LayoutTests/fast/repaint/table-outer-border-expected.checksum
new file mode 100644 (file)
index 0000000..c97dd8d
--- /dev/null
@@ -0,0 +1 @@
+8ed0c685c6c115266c4ce7e49152a0b9
\ No newline at end of file
diff --git a/LayoutTests/fast/repaint/table-outer-border-expected.png b/LayoutTests/fast/repaint/table-outer-border-expected.png
new file mode 100644 (file)
index 0000000..c3f1b5b
Binary files /dev/null and b/LayoutTests/fast/repaint/table-outer-border-expected.png differ
diff --git a/LayoutTests/fast/repaint/table-outer-border-expected.txt b/LayoutTests/fast/repaint/table-outer-border-expected.txt
new file mode 100644 (file)
index 0000000..84e9e95
--- /dev/null
@@ -0,0 +1,12 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x165
+  RenderBlock {HTML} at (0,0) size 800x165
+    RenderBody {BODY} at (8,8) size 784x149
+      RenderBlock {DIV} at (0,0) size 500x149
+        RenderTable {TABLE} at (0,0) size 132x149 [border: (7px none #808080)]
+          RenderTableSection {TBODY} at (7,7) size 117x134
+            RenderTableRow {TR} at (0,0) size 117x67
+              RenderTableCell {TD} at (0,25) size 117x17 [bgcolor=#008000] [border: (8px solid #008000)] [r=0 c=0 rs=1 cs=1]
+            RenderTableRow {TR} at (0,67) size 117x67
+              RenderTableCell {TD} at (0,92) size 117x17 [bgcolor=#008000] [border: (8px solid #008000)] [r=1 c=0 rs=1 cs=1]
diff --git a/LayoutTests/fast/repaint/table-outer-border.html b/LayoutTests/fast/repaint/table-outer-border.html
new file mode 100644 (file)
index 0000000..16aea30
--- /dev/null
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=12817</title>
+    <style type="text/css" media="all">
+        table {
+            border-collapse: collapse;
+        }
+        
+        table td {
+            border: 15px solid red;
+            background-color: green;
+            height: 50px;
+            width: 100px;
+        }
+        
+        table.green td {
+            border-color: green;
+        }
+    </style>
+    <script src="repaint.js"></script>
+    <script>
+        function repaintTest()
+        {
+            var container = document.getElementById('container');
+            var table = document.getElementById('table');
+            var newTable = table.cloneNode(true);
+            newTable.className = "green";
+            container.replaceChild(newTable, table);
+        }
+    </script>
+</head>
+<body onload="runRepaintTest();">
+    <div id="container" style="width: 500px;">
+        <table id="table">
+            <tr>
+                <td></td>
+            </tr>
+            <tr>
+                <td></td>
+            </tr>
+        </table>
+    </div>
+</body>
+</html>
index 84c0cd5..3ce4b92 100644 (file)
@@ -1,3 +1,16 @@
+2007-02-19  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Hyatt.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=12817
+          REGRESSION (r18634): Table border-collapse problems with right margin
+
+        Test: fast/repaint/table-outer-border.html
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::layout): Reordered to initialize horizontal overflow
+        after table sections have computed their outer horizontal borders.
+
 2007-02-19  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Darin
index 8b2110e..0e6413c 100644 (file)
@@ -290,9 +290,6 @@ void RenderTable::layout()
     //int oldWidth = m_width;
     calcWidth();
 
-    m_overflowWidth = m_width + (collapseBorders() ? outerBorderRight() - borderRight() : 0);
-    m_overflowLeft = collapseBorders() ? borderLeft() - outerBorderLeft() : 0;
-
     // FIXME: The optimisation below doesn't work since the internal table
     // layout could have changed.  we need to add a flag to the table
     // layout that tells us if something has changed in the min max
@@ -318,6 +315,9 @@ void RenderTable::layout()
         child = child->nextSibling();
     }
 
+    m_overflowWidth = m_width + (collapseBorders() ? outerBorderRight() - borderRight() : 0);
+    m_overflowLeft = collapseBorders() ? borderLeft() - outerBorderLeft() : 0;
+
     // If any table section moved vertically, we will just repaint everything from that
     // section down (it is quite unlikely that any of the following sections
     // did not shift).