Bug 100279 - Wrong column widths when a row has colspan and long unwrappable text and other rows cells width is specified with percentage
Summary: Wrong column widths when a row has colspan and long unwrappable text and othe...
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tables (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P1 Normal
Assignee: zalan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-24 12:24 PDT by Nicolás Cardelino
Modified: 2013-05-06 03:25 PDT (History)
2 users (show)

See Also:


Attachments
Last row cell with colspan=2 (610 bytes, text/html)
2012-10-24 12:24 PDT, Nicolás Cardelino
no flags Details
Last row cell with colspan=2 (599 bytes, text/html)
2012-10-24 12:33 PDT, Nicolás Cardelino
no flags Details
nowrap (474 bytes, text/html)
2013-05-06 01:51 PDT, zalan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolás Cardelino 2012-10-24 12:24:52 PDT
Created attachment 170446 [details]
Last row cell with colspan=2

If the last row of a table has colspan > 1 and contains a long unwrapped text, and the width of the first cell of previous rows is specified using percentage (for example 10%), those previous cells ignore the width and take 50% instead.

Given a 3 row table, with 2 columns where the last row has colspan = 2, and the first cell of the first 2 rows width is 10%, instead of this:

 10%
*--*------------------*
*--*------------------*
*---------------------*

you get this:

*----------*----------*
*----------*----------*
*---------------------*
Comment 1 Nicolás Cardelino 2012-10-24 12:33:23 PDT
Created attachment 170449 [details]
Last row cell with colspan=2
Comment 2 zalan 2013-05-06 01:51:46 PDT
Created attachment 200647 [details]
nowrap

Both Opera and Firefox disagree with WebKit rendering.
Comment 3 zalan 2013-05-06 03:25:41 PDT
<tr><td style="width:90%;"></td><td></td></tr>
<tr><td colspan="2"></td></tr>

in AutoTableLayout::calcEffectiveLogicalWidth(), we ignore the percent value, when the min/max column widths are calculated (colspan is present). The second column's auto width value negates the percentage value so the available width distribution is based on the cell's content width instead.
Shouldn't we do something like

if (percent and auto columns only)
    distribute (100-percent) across the auto columns

and go ahead with the 'allColsArePercent' calculation?