Bug 16112 - Some Web Inspector UI elements use offsetWidth and offsetHeight before the stylesheet loads
Summary: Some Web Inspector UI elements use offsetWidth and offsetHeight before the st...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Timothy Hatcher
Depends on:
Reported: 2007-11-24 00:08 PST by Timothy Hatcher
Modified: 2007-11-24 11:19 PST (History)
1 user (show)

See Also:

Patch (3.08 KB, patch)
2007-11-24 00:19 PST, Timothy Hatcher
no flags Details | Formatted Diff | Diff
Revised patch (5.97 KB, patch)
2007-11-24 10:34 PST, Timothy Hatcher
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
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

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