Closed Bug 577360 Opened 16 years ago Closed 16 years ago

document.body.clientWidth changes during onresize event (unmaximize)

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: thuejk, Unassigned)

References

()

Details

(Whiteboard: qawanted)

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4 Build Identifier: Firefox 3.6.6 document.body.clientWidth changes while body.onresize() is running. Reproducible: Always Steps to Reproduce: 1. Go to http://thuejk.dk/test.html 2. Maximize window 3. Unmaximize window Actual Results: My javascript onresize handler detects that document.body.clientWidth has changed while the handler was running. Expected Results: The size of the document body should be finalized before the body onresize handler is run.
I can't reproduce the problem using either trunk or 3.6.6 on Mac...
It is probably a timing issue. I was able to reproduce it on 2 different computers, but the line in the resize handler where document.body.clientWidth changed was not the same.
That seems fairly unlikely, unless the timing is in when the window manager resizes the window. When you get clientWidth the first time we make sure all the pending changes we control are flushed out....
E pur si muove! I tested and reproduced the bug on Linux (Iceweasel 3.5.10) and Windows 3.6.6, btw.
Martijn, can you reproduce on Windows?
Whiteboard: qawanted
So when the bug occurs, the red cross doesn't get its position updated when the window gets unmaximized? In that case, I can't reproduce the bug.
When the bug occurs you get an alert saying "document.body.clientWidth changed from NNN to MMM" where NNN and MMM are some numbers. Speaking of which... Thue, what numbers do you typically see there?
Ah bugger. I figured out that it was the scrollbars which disappears once I move the positioned elements inside the frame, which causes clientwidth to update. Sorry for the false bug report. :(
Ah, ok. Thanks for sorting that out!
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.