Bug 16112

Summary: Some Web Inspector UI elements use offsetWidth and offsetHeight before the stylesheet loads
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: Web Inspector (Deprecated)Assignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: mitz
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Revised patch aroben: review+

Description Timothy Hatcher 2007-11-24 00:08:05 PST
If the panel shows before the stylesheet loads then we will get 0 or a negative number from offsetWidth.
Comment 1 Timothy Hatcher 2007-11-24 00:19:57 PST
Created attachment 17482 [details]
Patch
Comment 2 mitz 2007-11-24 01:03:05 PST
Sounds like onload events for stylesheets could solve this...
Comment 3 Timothy Hatcher 2007-11-24 09:45:35 PST
DO we support load events for stylesheets?
Comment 4 mitz 2007-11-24 09:50:55 PST
(In reply to comment #3)
> DO we support load events for stylesheets?

I don't think so. I don't even know if they're spec'ed. (So my remark didn't mean to say that you should use them instead).
Comment 5 Timothy Hatcher 2007-11-24 10:19:00 PST
We also use offsetHeight when updating the DOM tree selection highlight. The highlight will show up filling the screen blue unless we wait for the stylesheet load.
Comment 6 Timothy Hatcher 2007-11-24 10:34:25 PST
Created attachment 17486 [details]
Revised patch
Comment 7 Adam Roben (:aroben) 2007-11-24 11:12:14 PST
Comment on attachment 17486 [details]
Revised patch

r=me
Comment 8 Timothy Hatcher 2007-11-24 11:19:12 PST
Landed in r27999. http://trac.webkit.org/projects/webkit/changeset/27999