Bug 26523 - <col> elements width can't be changed with javascript
Summary: <col> elements width can't be changed with javascript
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
: 15140 (view as bug list)
Depends on:
Reported: 2009-06-18 15:42 PDT by Jessie Berlin
Modified: 2009-06-26 09:12 PDT (History)
2 users (show)

See Also:

Tries to change the col width using both style.width and style (1.87 KB, text/html)
2009-06-18 15:44 PDT, Jessie Berlin
no flags Details
Patch (38.37 KB, patch)
2009-06-22 16:12 PDT, Beth Dakin
no flags Details | Formatted Diff | Diff
Bigger, better, stronger patch (40.19 KB, patch)
2009-06-23 16:00 PDT, Beth Dakin
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jessie Berlin 2009-06-18 15:42:45 PDT
When setting the style.width or width properties on a <col> element via Javascript, the change is made to the inline CSS on the element but the change is not reflected on the page. Possibly a case of not doing a re-layout to reflect the style change.
Comment 1 Jessie Berlin 2009-06-18 15:44:02 PDT
Created attachment 31514 [details]
Tries to change the col width using both style.width and style
Comment 2 Beth Dakin 2009-06-19 12:20:34 PDT
A work-around for the test case seems to be that you can reset the width of one the the table cells and all of the cells in that column will resize correctly to that size. This should still work for <col> though obviously, so I am still looking into that.
Comment 3 Beth Dakin 2009-06-22 13:10:44 PDT
Actually, it looks like forcing a layout will not fix this. The problem is that setPrefWidthsDirty() is not being called. I am going to try to figure out where that should be set.
Comment 4 Beth Dakin 2009-06-22 16:12:23 PDT
Created attachment 31689 [details]

Here is a patch that dirties the pref widths of the table whenever an HTMLColElement's width attribute is changed. This patch is not the best ever, because it means that col.style.width is still broken.
Comment 5 Beth Dakin 2009-06-23 16:00:18 PDT
Created attachment 31754 [details]
Bigger, better, stronger patch

Here's a new patch that takes some Hyatt-irc-feedback into account. This one is way better too because it fixed the bug for both col.width and col.style.width!
Comment 6 Dave Hyatt 2009-06-23 16:22:39 PDT
Comment on attachment 31754 [details]
Bigger, better, stronger patch

Make table() private on RenderTableCol.

Comment 7 Beth Dakin 2009-06-23 16:43:23 PDT
Made the table() function private, and committed this with revision 45015.
Comment 8 Jessie Berlin 2009-06-26 09:12:52 PDT
*** Bug 15140 has been marked as a duplicate of this bug. ***