Closed Bug 542375 Opened 14 years ago Closed 14 years ago

the clientWidth of a Textarea with 0px height reports incorrect results right after its .value and the .style.width are changed

Categories

(Core :: Layout, defect)

1.9.2 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: bugzilla, Unassigned)

References

()

Details

(Keywords: regression, testcase, Whiteboard: [Fixed by bug 563416])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6

See this JavaScript-code (this is performed in the link):

window.onload = function(){
	var t = document.getElementsByTagName("textarea")[0];
	alert(t.clientWidth);
	t.value = "";
	t.style.width = "200px";
	alert(t.clientWidth); //incorrect
	var z = t.style.zIndex;
	t.style.zIndex = "1";
	alert(t.clientWidth); //now it's correct
	t.style.zIndex = z;
	alert(t.clientWidth); //stays correct
}

Reproducible: Always

Steps to Reproduce:
1. Execute the code
2. See what you get
Actual Results:  
alerts:

178
178
200
200

Expected Results:  
alerts:

178
200
200
200
Version: unspecified → 3.6 Branch
Confirmed with latest trunk on Windows Vista. This worked fine with Firefox 3.5.
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Version: 3.6 Branch → 1.9.2 Branch
(In reply to comment #1)
> Confirmed with latest trunk on Windows Vista. This worked fine with Firefox
> 3.5.

Latest trunk works fine for me on Windows 7.

works:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20100128 Minefield/3.7a1pre
Results: 179 200 200 200

works:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a2pre) Gecko/20100216 Minefield/3.7a2pre
Results: 179 200 200 200


These regression ranges might not be true on other operating systems.

Regression range:

works:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2a1pre) Gecko/20090803 Minefield/3.6a1pre
http://hg.mozilla.org/mozilla-central/rev/51f332235f14
Results: 179 200 200 200

broken:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2a1pre) Gecko/20090804 Minefield/3.6a1pre
http://hg.mozilla.org/mozilla-central/rev/3ce467cf8e0d
Results: 179 179 200 200

http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=51f332235f14&tochange=3ce467cf8e0d


Regression range 2:

broken:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20091029 Minefield/3.7a1pre
http://hg.mozilla.org/mozilla-central/rev/ac98fd60de44
Results: 179 179 200 200

broken - different:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20091030 Minefield/3.7a1pre
http://hg.mozilla.org/mozilla-central/rev/001e14d17a30
Results: 179 179 179 179

http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ac98fd60de44&tochange=001e14d17a30


"Fixed" range:

broken - different:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20091111 Minefield/3.7a1pre
http://hg.mozilla.org/mozilla-central/rev/2eb351cc47d3
Results: 179 179 179 179

works:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a1pre) Gecko/20091112 Minefield/3.7a1pre
http://hg.mozilla.org/mozilla-central/rev/6628da386550
Results: 179 200 200 200

http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=2eb351cc47d3&tochange=6628da386550
So judging from the regression windows, I guess:
- bug 502288 could be responsible for the original regression
- bug 507764 made zIndex changes from script not reflow.
- From the third range, bug 259636 sounds the most related, but I don't see how it could fix this.

bz, does this sound plausible? Do you think anything should be done about this, given the regression is 1.9.2-only?
Summary: the clientWidth of a Textarea is not correct if its height is 0px and the value and the width is changed → the clientWidth of a Textarea with 0px height reports incorrect results right after its .value and the .style.width are changed
It seems like it's still broken if I don't change .value (i.e., remove the t.value = "" line from the testcase), though.
At least on Mac, this worksforme with the url in the url field (and of course the comment 4 testcase).  Is this windows-only?
Hmm, yes, I can reproduce on 
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (179, 179, 200, 200)

but not on:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (173, 200, 200, 200)
That's somewhat odd.  Do you have a Windows debug build, perchance?
Not from 1.9.2 brach, no.

BTW, I suspected it could be due to alert()s, so I made a version that only alerts after the script has run: http://mozilla.doslash.org/stuff/bug542375.html -- but it gives the same results on 3.6.3.

With that new version I also noticed that Windows *trunk* alerts 179,179,179,179 when using Undo Close Tab (but again not Mac)...
Do you have a windows trunk debug build?

If so, can I see a frame dump from after that undo close tab?
> If so, can I see a frame dump from after that undo close tab?
I answered in a new bug (bug 563416), since it's a different issue.
OK.  I think it's the same underlying problem, so marking dependency....
Depends on: 563416
I've made 1.9.2 TryServer builds with the fix in bug 563416 for testing:
https://build.mozilla.org/tryserver-builds/mpalmgren@mozilla.com-563416-192/
Fixed by bug 563416.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [Fixed by bug 563416]
Target Milestone: --- → mozilla1.9.3a5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: