Bug 82266

Summary: [test case] Caption width is too short
Product: [Applications] konqueror Reporter: Mattias Hermansson <mattias>
Component: khtml rendererAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: hadmut, lex.lists
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: test case

Description Mattias Hermansson 2004-05-26 20:31:50 UTC
Version:            (using KDE KDE 3.2.1)
Installed from:    Unlisted Binary Package
OS:                Linux

The caption is not rendered over the entire table. Check out this testcase with konq and mozilla

http://shayol-ghul.csbnet.se/~mattias/sadIII/caption3.html


Screenshots below:
http://shayol-ghul.csbnet.se/~mattias/sadIII/screen1.png
http://shayol-ghul.csbnet.se/~mattias/sadIII/screen2.png
Comment 1 Allan Sandfeld 2005-01-10 15:42:00 UTC
Webpage is no longer active.
Comment 2 Mattias Hermansson 2005-01-11 12:34:43 UTC
Sorry. Apache daemon went down. Webpage problem fixed.
Comment 3 lexual 2005-04-19 14:47:40 UTC
Site couldn't be visited 2005-April-19
Comment 4 lexual 2005-06-22 02:49:37 UTC
Mattias, I'm not 100% what the problem is. Can you please clarify what the problem is?
Comment 5 Mattias Hermansson 2005-06-22 08:41:55 UTC
The problem is that the caption isn't rendered over the entire table.

If you look at the right border, where the table and caption meet, you see that the caption is shorter than the rest of the table.
Comment 6 lexual 2005-07-11 04:43:32 UTC
Mattias, the above links are currently broken. Please consider creating attachments of those files so that your bug can be worked on regardless of the status of your web server.
Comment 7 Tommi Tervo 2005-08-03 12:55:26 UTC
Created attachment 12060 [details]
test case

Caption is two pixels narrower than table (3.5-branch)
Comment 8 Tommi Tervo 2006-03-20 09:12:35 UTC
*** Bug 123952 has been marked as a duplicate of this bug. ***
Comment 9 Allan Sandfeld 2006-10-18 22:00:54 UTC
SVN commit 596875 by carewolf:

captions are independent of tables border and padding
BUG: 82266


 M  +4 -0      render_box.cpp  


--- branches/KDE/3.5/kdelibs/khtml/rendering/render_box.cpp #596874:596875
@@ -707,6 +707,10 @@
     }
 
     RenderBlock* cb = containingBlock();
+    if (isRenderBlock() && cb->isTable()) {
+        //captions are not affected by table border or padding
+        return cb->width();
+    }
     if (usesLineWidth())
         return cb->lineWidth(m_y);
     else
Comment 10 Germain Garand 2006-10-22 02:44:42 UTC
+    if (isRenderBlock() && cb->isTable()) { 
+        //captions are not affected by table border or padding 

this doesn't screen out table cells, or I'm missing something?
 
Comment 11 Germain Garand 2007-01-02 11:51:06 UTC
SVN commit 618852 by ggarand:

don't let other elements go in there
e.g. <table border=5><tr><td style=position:relative;left:100%>X

CCBUG:82266



 M  +1 -1      render_box.cpp  
 M  +1 -0      render_table.h  


--- trunk/KDE/kdelibs/khtml/rendering/render_box.cpp #618851:618852
@@ -707,7 +707,7 @@
     }
 
     RenderBlock* cb = containingBlock();
-    if (isRenderBlock() && cb->isTable()) {
+    if (isRenderBlock() && cb->isTable() && static_cast<RenderTable*>(cb)->caption() == this) {
         //captions are not affected by table border or padding
         return cb->width();
     }
--- trunk/KDE/kdelibs/khtml/rendering/render_table.h #618851:618852
@@ -162,6 +162,7 @@
     CollapsedBorderValue* currentBorderStyle() { return m_currentBorder; }
 
     RenderTableSection *firstBodySection() const { return firstBody; }
+    RenderFlow*         caption() const { return tCaption; }
 
 protected: