Bug 5820 - Table cells with width:auto should use width from their <col>
Summary: Table cells with width:auto should use width from their <col>
Status: VERIFIED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tables (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Dave Hyatt
URL: http://www.ynet.co.il/articles/0,7340...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-24 11:00 PST by mitz
Modified: 2005-12-02 00:55 PST (History)
0 users

See Also:


Attachments
testcase (1.19 KB, text/html)
2005-11-24 11:01 PST, mitz
no flags Details
Use <col> width during layout when necessary (4.91 KB, patch)
2005-11-24 11:26 PST, mitz
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
testcase
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
Firefox.
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.