RESOLVED FIXED 26523
<col> elements width can't be changed with javascript
https://bugs.webkit.org/show_bug.cgi?id=26523
Summary <col> elements width can't be changed with javascript
Jessie Berlin
Reported 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.
Attachments
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
Patch (38.37 KB, patch)
2009-06-22 16:12 PDT, Beth Dakin
no flags
Bigger, better, stronger patch (40.19 KB, patch)
2009-06-23 16:00 PDT, Beth Dakin
hyatt: review+
Jessie Berlin
Comment 1 2009-06-18 15:44:02 PDT
Created attachment 31514 [details] Tries to change the col width using both style.width and style
Beth Dakin
Comment 2 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.
Beth Dakin
Comment 3 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.
Beth Dakin
Comment 4 2009-06-22 16:12:23 PDT
Created attachment 31689 [details] Patch 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.
Beth Dakin
Comment 5 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!
Dave Hyatt
Comment 6 2009-06-23 16:22:39 PDT
Comment on attachment 31754 [details] Bigger, better, stronger patch Make table() private on RenderTableCol. r=me
Beth Dakin
Comment 7 2009-06-23 16:43:23 PDT
Made the table() function private, and committed this with revision 45015.
Jessie Berlin
Comment 8 2009-06-26 09:12:52 PDT
*** Bug 15140 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.