Bug 129307

Summary: [test case]JavaScript: image dimensions not immediately readable
Product: [Applications] konqueror Reporter: jordan.osete
Component: khtml ecmaAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: lecit, maksim
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: A simple testcase

Description jordan.osete 2006-06-17 14:44:48 UTC
Version:           3.5.2 (using KDE 3.5.3, Debian Package 4:3.5.3-1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.15-1-k7

Hello, when you want to read the dimensions of an image using script, those dimensions are not immediately readeable, but you must wait like one second or so after the image has finished loading.
  <img src="animage.jpg" onload="alert(this.width+' '+this.height);" />
This will display an alert with "0 0" instead of the true dimensions of the image.
Comment 1 jordan.osete 2006-06-17 15:04:28 UTC
Created attachment 16651 [details]
A simple testcase

As you see, both the onload of the image and the onload of the body display
wrong dimensions, but if you later click on the image or on the link, it will
show the right ones (160*120).
Comment 2 Andreas Kling 2006-07-15 07:35:12 UTC
*** Bug 130845 has been marked as a duplicate of this bug. ***
Comment 3 Maksim Orlovich 2008-08-26 20:43:09 UTC
I think I just figured out a fix for this based on a different report