Bug 107521 - [test case] Small problem with position of a table at the bottom without putting the height in the <table>
Summary: [test case] Small problem with position of a table at the bottom without putt...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-16 11:19 UTC by Tom Albers
Modified: 2006-03-02 09:20 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
test (451 bytes, text/html)
2005-06-16 11:20 UTC, Tom Albers
Details
patch (2.07 KB, patch)
2006-02-28 22:09 UTC, Germain Garand
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Albers 2005-06-16 11:19:37 UTC
Version:           3.4.0 (using KDE 3.4.0, Debian Package 4:3.4.0-0pre2 (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-8)
OS:                Linux (i686) release 2.6.10-1-k7

Hello,

Whenever you put a table at the bottom of a page without specifying the height directly in the table, it is rendered from that position down.

I'll attach a small test case for this situation. Internet Explorer (tested with version 6) and Firefox 
(tested with version 1.0.1), render the boxes correctly, Konqueror (version 3.4.0) does not render the first box properly.

Tom
Comment 1 Tom Albers 2005-06-16 11:20:24 UTC
Created attachment 11477 [details]
test
Comment 2 Germain Garand 2006-02-28 22:09:26 UTC
Created attachment 14911 [details]
patch

calculate table height a bit differently for positioned tables, so as to get
accurate bottom positioning,
also adds table { box-sizing: border-box } to default sheet.
Comment 3 Germain Garand 2006-03-02 03:23:49 UTC
SVN commit 514954 by ggarand:

Use the calculated height for positioned tables, so as to always compute an accurate
position. 
Add box-sizing: border-box to table's default style 

BUG: 107521



 M  +1 -0      css/html4.css  
 M  +7 -3      rendering/render_box.cpp  
 M  +3 -1      rendering/render_table.cpp  


--- branches/KDE/3.5/kdelibs/khtml/css/html4.css #514953:514954
@@ -173,6 +173,7 @@
 	text-align: -khtml-auto;
 	border-spacing: 2px;
         -khtml-flow-mode: -khtml-around-floats;
+        box-sizing: border-box;
 }
 
 TABLE[align="center"] {
--- branches/KDE/3.5/kdelibs/khtml/rendering/render_box.cpp #514953:514954
@@ -1033,7 +1033,7 @@
     }
     if (result != -1) {
         result = height.width(result);
-        if (cb->isTableCell() && !isTable() && style()->boxSizing() != BORDER_BOX) {
+        if (cb->isTableCell() && style()->boxSizing() != BORDER_BOX) {
             result -= (borderTop() + paddingTop() + borderBottom() + paddingBottom());
             result = kMax(0, result);
         }
@@ -1467,8 +1467,12 @@
     else if (!height.isVariable())
     {
         h = height.width(ch);
-        if (ourHeight - pab > h)
-            ourHeight = h + pab;
+        if (ourHeight - pab > h) {
+            if (!isTable())
+                ourHeight = h + pab;
+            else
+                h = ourHeight - pab;
+        }
     }
     else if (isReplaced())
         h = intrinsicHeight();
--- branches/KDE/3.5/kdelibs/khtml/rendering/render_table.cpp #514953:514954
@@ -303,6 +303,8 @@
     m_height += bpTop;
 
     int oldHeight = m_height;
+    if (isPositioned())
+        m_height += calculatedHeight + bpBottom;
     calcHeight();
     int newHeight = m_height;
     m_height = oldHeight;
@@ -310,7 +312,7 @@
     Length h = style()->height();
     int th = -(bpTop + bpBottom); // Tables size as though CSS height includes border/padding.
     if (isPositioned())
-        th = newHeight; // FIXME: Leave this alone for now but investigate later.
+        th += newHeight;
     else if (h.isFixed())
         th += h.value();
     else if (h.isPercent())
Comment 4 Tom Albers 2006-03-02 09:20:27 UTC
Great! Thanks! Looking forward to the next release.