2007-06-25 Mitz Pettel <mitz@webkit.org>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2007 10:31:54 +0000 (10:31 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2007 10:31:54 +0000 (10:31 +0000)
        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=14202
          Table caption renders too narrow sometimes

        Test: fast/table/caption-relayout.html

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::layout): Mark the caption for layout if the table
        width changed.

2007-06-25  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Darin.

        - test and updated results for http://bugs.webkit.org/show_bug.cgi?id=14202
          Table caption renders too narrow sometimes

        * fast/table/caption-relayout-expected.checksum: Added.
        * fast/table/caption-relayout-expected.png: Added.
        * fast/table/caption-relayout-expected.txt: Added.
        * fast/table/caption-relayout.html: Added.
        * tables/mozilla/marvin/x_caption_class-expected.checksum:
        * tables/mozilla/marvin/x_caption_class-expected.png:
        * tables/mozilla/marvin/x_caption_class-expected.txt:
        * tables/mozilla/marvin/x_caption_id-expected.checksum:
        * tables/mozilla/marvin/x_caption_id-expected.png:
        * tables/mozilla/marvin/x_caption_id-expected.txt:
        * tables/mozilla/marvin/x_caption_style-expected.checksum:
        * tables/mozilla/marvin/x_caption_style-expected.png:
        * tables/mozilla/marvin/x_caption_style-expected.txt:
        * tables/mozilla_expected_failures/bugs/bug29058-2-expected.checksum:
        * tables/mozilla_expected_failures/bugs/bug29058-2-expected.png:
        * tables/mozilla_expected_failures/bugs/bug29058-2-expected.txt:
        * tables/mozilla_expected_failures/bugs/bug3166-5-expected.checksum:
        * tables/mozilla_expected_failures/bugs/bug3166-5-expected.png:
        * tables/mozilla_expected_failures/bugs/bug3166-5-expected.txt:
        * tables/mozilla_expected_failures/bugs/bug3166-6-expected.checksum:
        * tables/mozilla_expected_failures/bugs/bug3166-6-expected.png:
        * tables/mozilla_expected_failures/bugs/bug3166-6-expected.txt:
        * tables/mozilla_expected_failures/bugs/bug3166-9-expected.checksum:
        * tables/mozilla_expected_failures/bugs/bug3166-9-expected.png:
        * tables/mozilla_expected_failures/bugs/bug3166-9-expected.txt:

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

28 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/table/caption-relayout-expected.checksum [new file with mode: 0644]
LayoutTests/fast/table/caption-relayout-expected.png [new file with mode: 0644]
LayoutTests/fast/table/caption-relayout-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/caption-relayout.html [new file with mode: 0644]
LayoutTests/tables/mozilla/marvin/x_caption_class-expected.checksum
LayoutTests/tables/mozilla/marvin/x_caption_class-expected.png
LayoutTests/tables/mozilla/marvin/x_caption_class-expected.txt
LayoutTests/tables/mozilla/marvin/x_caption_id-expected.checksum
LayoutTests/tables/mozilla/marvin/x_caption_id-expected.png
LayoutTests/tables/mozilla/marvin/x_caption_id-expected.txt
LayoutTests/tables/mozilla/marvin/x_caption_style-expected.checksum
LayoutTests/tables/mozilla/marvin/x_caption_style-expected.png
LayoutTests/tables/mozilla/marvin/x_caption_style-expected.txt
LayoutTests/tables/mozilla_expected_failures/bugs/bug29058-2-expected.checksum
LayoutTests/tables/mozilla_expected_failures/bugs/bug29058-2-expected.png
LayoutTests/tables/mozilla_expected_failures/bugs/bug29058-2-expected.txt
LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-5-expected.checksum
LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-5-expected.png
LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-5-expected.txt
LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-6-expected.checksum
LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-6-expected.png
LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-6-expected.txt
LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-9-expected.checksum
LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-9-expected.png
LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-9-expected.txt
WebCore/ChangeLog
WebCore/rendering/RenderTable.cpp

index 02723d4..ce73317 100644 (file)
@@ -2,6 +2,39 @@
 
         Reviewed by Darin.
 
+        - test and updated results for http://bugs.webkit.org/show_bug.cgi?id=14202
+          Table caption renders too narrow sometimes
+
+        * fast/table/caption-relayout-expected.checksum: Added.
+        * fast/table/caption-relayout-expected.png: Added.
+        * fast/table/caption-relayout-expected.txt: Added.
+        * fast/table/caption-relayout.html: Added.
+        * tables/mozilla/marvin/x_caption_class-expected.checksum:
+        * tables/mozilla/marvin/x_caption_class-expected.png:
+        * tables/mozilla/marvin/x_caption_class-expected.txt:
+        * tables/mozilla/marvin/x_caption_id-expected.checksum:
+        * tables/mozilla/marvin/x_caption_id-expected.png:
+        * tables/mozilla/marvin/x_caption_id-expected.txt:
+        * tables/mozilla/marvin/x_caption_style-expected.checksum:
+        * tables/mozilla/marvin/x_caption_style-expected.png:
+        * tables/mozilla/marvin/x_caption_style-expected.txt:
+        * tables/mozilla_expected_failures/bugs/bug29058-2-expected.checksum:
+        * tables/mozilla_expected_failures/bugs/bug29058-2-expected.png:
+        * tables/mozilla_expected_failures/bugs/bug29058-2-expected.txt:
+        * tables/mozilla_expected_failures/bugs/bug3166-5-expected.checksum:
+        * tables/mozilla_expected_failures/bugs/bug3166-5-expected.png:
+        * tables/mozilla_expected_failures/bugs/bug3166-5-expected.txt:
+        * tables/mozilla_expected_failures/bugs/bug3166-6-expected.checksum:
+        * tables/mozilla_expected_failures/bugs/bug3166-6-expected.png:
+        * tables/mozilla_expected_failures/bugs/bug3166-6-expected.txt:
+        * tables/mozilla_expected_failures/bugs/bug3166-9-expected.checksum:
+        * tables/mozilla_expected_failures/bugs/bug3166-9-expected.png:
+        * tables/mozilla_expected_failures/bugs/bug3166-9-expected.txt:
+
+2007-06-25  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
         - pixel test for http://bugs.webkit.org/show_bug.cgi?id=14245
           Underline painted under <br>, not repainted properly
 
diff --git a/LayoutTests/fast/table/caption-relayout-expected.checksum b/LayoutTests/fast/table/caption-relayout-expected.checksum
new file mode 100644 (file)
index 0000000..ad4828a
--- /dev/null
@@ -0,0 +1 @@
+52518a896a9d55f9fb727590d20083cc
\ No newline at end of file
diff --git a/LayoutTests/fast/table/caption-relayout-expected.png b/LayoutTests/fast/table/caption-relayout-expected.png
new file mode 100644 (file)
index 0000000..17318d4
Binary files /dev/null and b/LayoutTests/fast/table/caption-relayout-expected.png differ
diff --git a/LayoutTests/fast/table/caption-relayout-expected.txt b/LayoutTests/fast/table/caption-relayout-expected.txt
new file mode 100644 (file)
index 0000000..063fb92
--- /dev/null
@@ -0,0 +1,10 @@
+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
+      RenderTable {TABLE} at (0,0) size 102x100
+        RenderBlock {CAPTION} at (0,0) size 102x50 [bgcolor=#008000]
+        RenderTableSection {TBODY} at (0,50) size 102x50
+          RenderTableRow {TR} at (0,0) size 102x50
+            RenderTableCell {TD} at (0,24) size 102x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
diff --git a/LayoutTests/fast/table/caption-relayout.html b/LayoutTests/fast/table/caption-relayout.html
new file mode 100644 (file)
index 0000000..dbd71fa
--- /dev/null
@@ -0,0 +1,18 @@
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=14202</title>
+</head>
+<body>
+    <table style="border-collapse: collapse;">
+        <caption style="background-color: green; height: 50px;"></caption>
+        <tr>
+            <td id="target" style="background-color: green; height: 50px; width: 50px;">
+            </td>
+        </tr>
+    </table>
+    <script>
+        document.body.offsetTop;
+        document.getElementById('target').style.width = "100px";
+    </script>
+</body>
+</html>
index ac8c72d..d4a3b12 100644 (file)
@@ -1 +1 @@
-f88098346e22c402df41bf08c6b6c70d
\ No newline at end of file
+aad12e0da72cb41a66026e64c7e9dee9
\ No newline at end of file
index 9599c58..bb63657 100644 (file)
Binary files a/LayoutTests/tables/mozilla/marvin/x_caption_class-expected.png and b/LayoutTests/tables/mozilla/marvin/x_caption_class-expected.png differ
index 4d0ae44..fc0fb07 100644 (file)
@@ -4,10 +4,10 @@ layer at (0,0) size 800x62
   RenderBlock {html} at (0,0) size 800x62
     RenderBody {body} at (8,8) size 784x46
       RenderTable {table} at (0,0) size 784x46 [border: (1px outset #808080)]
-        RenderBlock {caption} at (0,0) size 767x18 [bgcolor=#00FF00]
-          RenderText {#text} at (244,0) size 279x18
-            text run at (244,0) width 204: "This caption should have a lime "
-            text run at (448,0) width 75: "background"
+        RenderBlock {caption} at (0,0) size 782x18 [bgcolor=#00FF00]
+          RenderText {#text} at (251,0) size 279x18
+            text run at (251,0) width 204: "This caption should have a lime "
+            text run at (455,0) width 75: "background"
         RenderTableSection at (1,19) size 782x26
           RenderTableRow {tr} at (0,2) size 782x22
             RenderTableCell {td} at (2,2) size 778x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
index ac8c72d..d4a3b12 100644 (file)
@@ -1 +1 @@
-f88098346e22c402df41bf08c6b6c70d
\ No newline at end of file
+aad12e0da72cb41a66026e64c7e9dee9
\ No newline at end of file
index 9599c58..bb63657 100644 (file)
Binary files a/LayoutTests/tables/mozilla/marvin/x_caption_id-expected.png and b/LayoutTests/tables/mozilla/marvin/x_caption_id-expected.png differ
index 4d0ae44..fc0fb07 100644 (file)
@@ -4,10 +4,10 @@ layer at (0,0) size 800x62
   RenderBlock {html} at (0,0) size 800x62
     RenderBody {body} at (8,8) size 784x46
       RenderTable {table} at (0,0) size 784x46 [border: (1px outset #808080)]
-        RenderBlock {caption} at (0,0) size 767x18 [bgcolor=#00FF00]
-          RenderText {#text} at (244,0) size 279x18
-            text run at (244,0) width 204: "This caption should have a lime "
-            text run at (448,0) width 75: "background"
+        RenderBlock {caption} at (0,0) size 782x18 [bgcolor=#00FF00]
+          RenderText {#text} at (251,0) size 279x18
+            text run at (251,0) width 204: "This caption should have a lime "
+            text run at (455,0) width 75: "background"
         RenderTableSection at (1,19) size 782x26
           RenderTableRow {tr} at (0,2) size 782x22
             RenderTableCell {td} at (2,2) size 778x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
index ac8c72d..d4a3b12 100644 (file)
@@ -1 +1 @@
-f88098346e22c402df41bf08c6b6c70d
\ No newline at end of file
+aad12e0da72cb41a66026e64c7e9dee9
\ No newline at end of file
index 9599c58..bb63657 100644 (file)
Binary files a/LayoutTests/tables/mozilla/marvin/x_caption_style-expected.png and b/LayoutTests/tables/mozilla/marvin/x_caption_style-expected.png differ
index 6470915..b9cd76e 100644 (file)
@@ -4,10 +4,10 @@ layer at (0,0) size 800x62
   RenderBlock {html} at (0,0) size 800x62
     RenderBody {body} at (8,8) size 784x46
       RenderTable {table} at (0,0) size 784x46 [border: (1px outset #808080)]
-        RenderBlock {caption} at (0,0) size 767x18 [bgcolor=#00FF00]
-          RenderText {#text} at (244,0) size 279x18
-            text run at (244,0) width 173: "This caption should have a "
-            text run at (417,0) width 106: "lime background"
+        RenderBlock {caption} at (0,0) size 782x18 [bgcolor=#00FF00]
+          RenderText {#text} at (251,0) size 279x18
+            text run at (251,0) width 173: "This caption should have a "
+            text run at (424,0) width 106: "lime background"
         RenderTableSection at (1,19) size 782x26
           RenderTableRow {tr} at (0,2) size 782x22
             RenderTableCell {td} at (2,2) size 778x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
index c950cc7..40e59fb 100644 (file)
Binary files a/LayoutTests/tables/mozilla_expected_failures/bugs/bug29058-2-expected.png and b/LayoutTests/tables/mozilla_expected_failures/bugs/bug29058-2-expected.png differ
index 17b3bd3..6ec2a07 100644 (file)
@@ -60,9 +60,9 @@ layer at (0,0) size 800x542
           text run at (0,36) width 122: "expand are needed "
           text run at (122,36) width 115: "for other columns."
       RenderTable {TABLE} at (0,246) size 784x46 [border: (1px outset #808080)]
-        RenderBlock {CAPTION} at (0,0) size 767x18
-          RenderText {#text} at (277,0) size 213x18
-            text run at (277,0) width 213: "Table with width attribute =100%"
+        RenderBlock {CAPTION} at (0,0) size 782x18
+          RenderText {#text} at (284,0) size 213x18
+            text run at (284,0) width 213: "Table with width attribute =100%"
         RenderTableCol {COL} at (0,0) size 0x0
         RenderTableCol {COL} at (0,0) size 0x0
         RenderTableCol {COL} at (0,0) size 0x0
@@ -110,9 +110,9 @@ layer at (0,0) size 800x542
         RenderText {#text} at (0,0) size 43x18
           text run at (0,0) width 43: "correct"
       RenderTable {TABLE} at (0,438) size 784x46 [border: (1px outset #808080)]
-        RenderBlock {CAPTION} at (0,0) size 767x18
-          RenderText {#text} at (277,0) size 213x18
-            text run at (277,0) width 213: "Table with width attribute =100%"
+        RenderBlock {CAPTION} at (0,0) size 782x18
+          RenderText {#text} at (284,0) size 213x18
+            text run at (284,0) width 213: "Table with width attribute =100%"
         RenderTableCol {COL} at (0,0) size 0x0
         RenderTableCol {COL} at (0,0) size 0x0
         RenderTableCol {COL} at (0,0) size 0x0
index 86a838d..bd8078a 100644 (file)
Binary files a/LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-5-expected.png and b/LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-5-expected.png differ
index 950c694..3121ef1 100644 (file)
@@ -4,9 +4,9 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584 [bgcolor=#FFFFFF]
       RenderTable {TABLE} at (0,0) size 784x144 [border: (3px solid #008000)]
-        RenderBlock {CAPTION} at (0,0) size 763x24 [border: (3px solid #FFA500)]
-          RenderText {#text} at (345,3) size 73x18
-            text run at (345,3) width 73: "caption text"
+        RenderBlock {CAPTION} at (0,0) size 778x24 [border: (3px solid #FFA500)]
+          RenderText {#text} at (352,3) size 73x18
+            text run at (352,3) width 73: "caption text"
         RenderTableSection {TBODY} at (3,27) size 778x114
           RenderTableRow {TR} at (0,2) size 778x110
             RenderTableCell {TD} at (2,2) size 774x110 [r=0 c=0 rs=1 cs=1]
index 83736de..ab7db9d 100644 (file)
Binary files a/LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-6-expected.png and b/LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-6-expected.png differ
index 93daadf..74da8ec 100644 (file)
@@ -4,9 +4,9 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584 [bgcolor=#FFFFFF]
       RenderTable {TABLE} at (0,0) size 784x324 [border: (3px solid #008000)]
-        RenderBlock {CAPTION} at (0,0) size 763x24 [border: (3px solid #FFA500)]
-          RenderText {#text} at (268,3) size 227x18
-            text run at (268,3) width 227: "caption text caption text caption text"
+        RenderBlock {CAPTION} at (0,0) size 778x24 [border: (3px solid #FFA500)]
+          RenderText {#text} at (275,3) size 227x18
+            text run at (275,3) width 227: "caption text caption text caption text"
         RenderTableSection {TBODY} at (3,27) size 778x294
           RenderTableRow {TR} at (0,2) size 778x290
             RenderTableCell {TD} at (2,2) size 774x290 [r=0 c=0 rs=1 cs=1]
index 1d090a9..cbc5e5b 100644 (file)
Binary files a/LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-9-expected.png and b/LayoutTests/tables/mozilla_expected_failures/bugs/bug3166-9-expected.png differ
index 12701de..bf6cb98 100644 (file)
@@ -4,9 +4,9 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584 [bgcolor=#FFFFFF]
       RenderTable {TABLE} at (0,0) size 784x324 [border: (3px solid #008000)]
-        RenderBlock {CAPTION} at (0,0) size 387x24 [border: (3px solid #FFA500)]
-          RenderText {#text} at (80,3) size 227x18
-            text run at (80,3) width 227: "caption text caption text caption text"
+        RenderBlock {CAPTION} at (0,0) size 395x24 [border: (3px solid #FFA500)]
+          RenderText {#text} at (84,3) size 227x18
+            text run at (84,3) width 227: "caption text caption text caption text"
         RenderTableSection {TBODY} at (3,27) size 778x294
           RenderTableRow {TR} at (0,2) size 778x290
             RenderTableCell {TD} at (2,2) size 774x290 [r=0 c=0 rs=1 cs=1]
index 3ad5290..8da8e8d 100644 (file)
@@ -2,6 +2,19 @@
 
         Reviewed by Darin.
 
+        - fix http://bugs.webkit.org/show_bug.cgi?id=14202
+          Table caption renders too narrow sometimes
+
+        Test: fast/table/caption-relayout.html
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::layout): Mark the caption for layout if the table
+        width changed.
+
+2007-06-25  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
         - fix http://bugs.webkit.org/show_bug.cgi?id=14245
           Underline painted under <br>, not repainted properly
 
index f3aba12..bb6730a 100644 (file)
@@ -276,9 +276,12 @@ void RenderTable::layout()
     m_overflowTop = 0;
     initMaxMarginValues();
     
-    //int oldWidth = m_width;
+    int oldWidth = m_width;
     calcWidth();
 
+    if (m_caption && m_width != oldWidth)
+        m_caption->setNeedsLayout(true, false);
+
     // 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