Bug 115356

Summary: Khtml doesn't render tables with border-collapse: collapse and borders set on thead, tfoot and tbody
Product: [Applications] konqueror Reporter: Pavel Simerda <pavel.simerda>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Page source (valid and clean)
Screenshot from konqueror (with bugs)
Expected rendering (firefox)

Description Pavel Simerda 2005-10-30 01:07:27 UTC
Version:            (using KDE KDE 3.4.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

There's a clean example of a styled table. It contains thead, tfoot and tbody, all with table rows.

These css rules are specified:
---------------------------
table {
  border-collapse: collapse;
  border-width: 2px;
  border-style: solid;
}
thead, tbody {
  border-width: 2px;
  border-style: solid;
}
td, th {
  border-width: 1px;
  border-style: solid;
}
---------------------------
Expected behaviour:

You shoud see a table with 2px border around it and between parts of the table. Cells are divided by 1px border.
---------------------------
Khtml bugs:

1) Tfoot element is shifted by some 2 pixels to the left.

2) Borders between two tbody elements and between thead and tbody did not collapse. They are 4px instead of 2px.
---------------------------
I will append the testcase and screenshots
Comment 1 Pavel Simerda 2005-10-30 01:09:31 UTC
Created attachment 13215 [details]
Page source (valid and clean)
Comment 2 Pavel Simerda 2005-10-30 01:12:29 UTC
Created attachment 13216 [details]
Screenshot from konqueror (with bugs)
Comment 3 Pavel Simerda 2005-10-30 01:13:16 UTC
Created attachment 13217 [details]
Expected rendering (firefox)
Comment 4 Tommi Tervo 2006-05-05 11:48:40 UTC

*** This bug has been marked as a duplicate of 108047 ***
Comment 5 Allan Sandfeld 2006-10-14 20:30:48 UTC
SVN commit 595538 by carewolf:

Table-sections do not have their own border in collapsed-border model.
BUG: 108047
CCBUG: 115356


 M  +5 -0      render_table.h  


--- branches/KDE/3.5/kdelibs/khtml/rendering/render_table.h #595537:595538
@@ -248,6 +248,11 @@
     virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const;
     virtual int highestPosition(bool includeOverflowInterior, bool includeSelf) const;
 
+    int borderLeft() const { return table()->collapseBorders() ? 0 : RenderBox::borderLeft(); }
+    int borderRight() const { return table()->collapseBorders() ? 0 : RenderBox::borderRight(); }
+    int borderTop() const { return table()->collapseBorders() ? 0 : RenderBox::borderTop(); }
+    int borderBottom() const { return table()->collapseBorders() ? 0 : RenderBox::borderBottom(); }
+
     virtual void paint( PaintInfo& i, int tx, int ty);
 
     int numRows() const { return grid.size(); }