Bug 133001

Summary: [test case] Table <caption> does not resize along with table when browser window resized
Product: [Applications] konqueror Reporter: Andrew Greenwood <andrew.greenwood>
Component: khtml rendererAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 3.5   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: test case attached

Description Andrew Greenwood 2006-08-26 00:02:50 UTC
Version:           3.5.4 (using KDE 3.5.4, Arch Linux)
Compiler:          Target: i686-pc-linux-gnu
OS:                Linux (i686) release 2.6.17-ARCH

When resizing the browser window, tables are resized. However, their captions remain at the original size when they should resize along with the table.

It appears that during the initial rendering of the page, the caption tag is rendered at the correct size.

Firefox and Internet Explorer do not exhibit this behaviour.

The following HTML will cause Konqueror to exhibit this problem:

<table style="width: 100%; border: 1px solid black;">
<caption style="background-color: gray;">Caption here</caption>
<tr>
        <td>moo</td>
</tr>
</table>
Comment 1 Tommi Tervo 2006-08-26 09:11:23 UTC
Created attachment 17506 [details]
test case attached
Comment 2 Germain Garand 2006-08-26 09:59:11 UTC
SVN commit 577316 by ggarand:

mark table caption for layout if needed.

BUG: 133001



 M  +4 -1      render_table.cpp  


--- branches/KDE/3.5/kdelibs/khtml/rendering/render_table.cpp #577315:577316
@@ -283,9 +283,12 @@
     m_height = 0;
     initMaxMarginValues();
 
-    //int oldWidth = m_width;
+    int oldWidth = m_width;
     calcWidth();
     m_overflowWidth = m_width;
+    
+    if (tCaption && (oldWidth != m_width || tCaption->style()->height().isPercent()))
+        tCaption->setChildNeedsLayout(true);
 
     // the optimization below doesn't work since the internal table
     // layout could have changed.  we need to add a flag to the table