Bug 100279

Summary: Wrong column widths when a row has colspan and long unwrappable text and other rows cells width is specified with percentage
Product: WebKit Reporter: Nicolás Cardelino <ncardeli>
Component: TablesAssignee: zalan <zalan>
Status: ASSIGNED ---    
Severity: Normal CC: arpitabahuguna, hyatt
Priority: P1    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows 7   
Attachments:
Description Flags
Last row cell with colspan=2
none
Last row cell with colspan=2
none
nowrap none

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?