| Summary: | [test case] percent width become shorter when CSS fixed table-layout [PATCH] | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | T. Watanabe <t-wata> |
| Component: | khtml renderer | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | apaku, philipp.sternberg |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
test case
The same symptoms, possibly a different reason |
||
Yup, this behavior still occurs in HEAD. Problem still occurs in KDE 3.2. Created attachment 9890 [details]
test case
clickable test case
*** Bug 118183 has been marked as a duplicate of this bug. *** Created attachment 14107 [details]
The same symptoms, possibly a different reason
SVN commit 552382 by carewolf:
Fix fixed-layout with percentages
BUG: 67849
M +0 -2 table_layout.cpp
--- branches/KDE/3.5/kdelibs/khtml/rendering/table_layout.cpp #552381:552382
@@ -288,8 +288,6 @@
int base = tableWidth * totalPercent / 100;
if ( base > available )
base = available;
- else
- totalPercent = 100;
#ifdef DEBUG_LAYOUT
qDebug("FixedTableLayout::layout: assigning percent width, base=%d, totalPercent=%d", base, totalPercent);
*** Bug 108239 has been marked as a duplicate of this bug. *** |
Version: (using KDE KDE 3.1.4) Installed from: Unspecified When I specify both percentage widths and other type widths (eg. "auto" or "em" unit) for table columns, the columns having percentage widths will be rendered too narrow. See the following test-case. =-=-= <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>test</title> <meta http-equiv="Content-Style-Type" content="text/css"> </head> <body> <table style="width: 100%; table-layout: fixed"> <col style="background: #f99; width: 4em"> <col style="background: #f99; width: auto"> <col style="background: #f99; width: 50%"> <tbody><tr><td>4em</td><td>auto</td><td>50%</td></tr></tbody> </table> </body> </html> =-=-= I have made a patch. =-=-= --- kdelibs-3.1.4/khtml/rendering/table_layout.cpp.orig Sat Jul 19 20:47:54 2003 +++ kdelibs-3.1.4/khtml/rendering/table_layout.cpp Tue Nov 11 11:17:02 2003 @@ -284,15 +284,18 @@ // assign percent width if ( available > 0 ) { int totalPercent = 0; + bool onlyPercent = true; for ( int i = 0; i < nEffCols; i++ ) if ( width[i].isPercent() ) totalPercent += width[i].value(); + else + onlyPercent = false; // calculate how much to distribute to percent cells. int base = tableWidth * totalPercent / 100; if ( base > available ) base = available; - else + else if (onlyPercent) totalPercent = 100; #ifdef DEBUG_LAYOUT =-=-=