Bug 5820

Summary: Table cells with width:auto should use width from their <col>
Product: WebKit Reporter: mitz
Component: TablesAssignee: Dave Hyatt <hyatt>
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://www.ynet.co.il/articles/0,7340,L-3174419,00.html
Description Flags
Use <col> width during layout when necessary darin: review+

Description mitz 2005-11-24 11:00:17 PST
A table cell whose width is 'auto' should use the width property of the corresponding col element if there 
is one.

WinIE renders the testcase as expected.
Comment 1 mitz 2005-11-24 11:01:30 PST
Created attachment 4790 [details]
Comment 2 mitz 2005-11-24 11:26:02 PST
Created attachment 4791 [details]
Use <col> width during layout when necessary

I am not sure that this is the right approach (rather than doing some crazy CSS
"inheritance"). Also, for table cells with colspan > 1, it falls back on
"auto", which didn't seem worse than any other option I tried or what I saw in
Comment 3 Darin Adler 2005-11-25 13:54:42 PST
Comment on attachment 4791 [details]
Use <col> width during layout when necessary

This looks just right to me. r=me

If it was me, I would have used a return rather than "w=" in
RenderTableCell::styleOrColWidth, but there are arguments that go both ways on
this very minor coding style issue.

It would be slightly better if RenderTableCell::calcMinMaxWidth() was written
so that it did not call styleOrColWidth() unless nowrap is set, but worrying
about this smacks of premature optimization.