dynamic change to width of table doesn't work




Layout: Tables
14 years ago
14 years ago


(Reporter: Jeremy, Assigned: Bernd)




Firefox Tracking Flags

(Not tracked)



(2 attachments)



14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007

DOM elements can no longer have their width changed.  I have verified that the
HTML below works in Mozilla 1.4, Opera, and Internet Explorer.  It does not work
in Mozilla 1.5.  This code should cause the table's width to be increased from
200 to 400, but it does nothing in Mozilla 1.5

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<title>Test Document</title>
<script language="JavaScript">
function changeWidth()
    var table = document.getElementById('test_table');

    table.style.width = 400;

    return false;

<table id="test_table" width="200" style="border: 1px solid blue;">

<a href="" onClick="return changeWidth();">Change Table Width</a>


Reproducible: Always

Steps to Reproduce:
1. Load HTML in browser
2. Click on the Change Table Width link
3. Note that the table does not change width

Actual Results:  
No change

Expected Results:  
Changed the width of the table.
We're getting the correct reflow hint for the table; the table is just not
reflowing for some reason....
Assignee: dom_bugs → table
Component: DOM Style → Layout: Tables
Created attachment 133480 [details]
This broke between 2003-08-13-05 and 2003-08-14-22.  Looking at the checkin
range, bug 198506 seems like the most likely culprit, and indeed backing out
that patch fixes the problem here.
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
mkaply told me that patch broke horizontal resizing of tables in the editor as
well -- didn't get a chance to file a bug, but it's probably the same issue.
Summary: Cannot change width of a DOM element → dynamic change to width of table doesn't work
At a guess, the incremental reflow now just reflows the kids at the table's old
width, then decides there's no reason to change the width of the table....  But
this is based on a total of about 200 seconds of looking at
nsTableFrame::Reflow, so take it with a grain of salt.

Comment 6

14 years ago
once this gets fixed, please remember to check if we get back the problem with
xml prettyprinting.

Comment 7

14 years ago
Created attachment 133576 [details] [diff] [review]
brute force patch
Comment on attachment 133576 [details] [diff] [review]
brute force patch

r+sr=bzbarsky.	Per discussion on irc, this is the only way to fly.
Attachment #133576 - Flags: superreview+
Attachment #133576 - Flags: review+

Comment 9

14 years ago
fix checked in after some baking it should go into 1.4.2 
Comment on attachment 133576 [details] [diff] [review]
brute force patch

Are there some other related patches that should go in as well?
Attachment #133576 - Flags: approval1.4.2?

Comment 11

14 years ago
hopefully not, at least I am not aware of any patch that should also go in.
*** Bug 223887 has been marked as a duplicate of this bug. ***

Comment 13

14 years ago
Comment on attachment 133576 [details] [diff] [review]
brute force patch

a=mkaply for 1.4.2
Attachment #133576 - Flags: approval1.4.2? → approval1.4.2+

Comment 14

14 years ago
taking for checkin
Assignee: table → bernd_mozilla

Comment 15

14 years ago
fix checked in
Last Resolved: 14 years ago
Resolution: --- → FIXED


14 years ago
Keywords: fixed1.4.2
You need to log in before you can comment on or make changes to this bug.