Bug 133001 - [test case] Table <caption> does not resize along with table when browser window resized
Summary: [test case] Table <caption> does not resize along with table when browser win...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: 3.5
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-26 00:02 UTC by Andrew Greenwood
Modified: 2006-08-26 09:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
test case attached (160 bytes, text/html)
2006-08-26 09:11 UTC, Tommi Tervo
Details

Note You need to log in before you can comment on or make changes to this bug.
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