Bug 17351 - Rendering differs depending on the order that files are fetched
Summary: Rendering differs depending on the order that files are fetched
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://www.macosforge.org/files/offse...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-13 15:12 PST by William Siegrist
Modified: 2008-02-19 08:28 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Siegrist 2008-02-13 15:12:05 PST
A page with a link to a stylesheet and a link to a javascript file that changes some styles, will actually render differently based on which of those 2 links is fetched first. 

Firefox seems to treat them "top down" in the ultimate HTML but nightly webkit can be made to change its rendering with enough pushing of the refresh button. 

An "inlined" version that does not exhibit this behavior is here:
http://www.macosforge.org/files/offset_test/inline.html
Comment 1 mitz 2008-02-14 09:52:29 PST
When the script asks for contdiv.offsetHeight, if the style sheet has not loaded yet, then the result will be 0. Script execution does not block on pending style sheets.
Comment 2 William Siegrist 2008-02-14 10:23:42 PST
So document.onload fires before the stylesheets are processed?
Comment 3 mitz 2008-02-17 09:53:18 PST
(In reply to comment #2)
> So document.onload fires before the stylesheets are processed?

This statement:

document.onload = resize_content();

calls resize_content() *immediately* (and sets document.onload to null). You probably meant to do

window.onload = resize_content;

(setting the property to the function, not its return value). Note that if you do that, then the document.write statement in resize_content() will replace the document's contents, so I suggest that you remove it as well.
Comment 4 William Siegrist 2008-02-17 10:53:57 PST
Thanks, I should have caught the () being there at least.  So should this be resolved "Invalid" now? 
Comment 5 mitz 2008-02-19 08:28:53 PST
I think there is a separate bug requesting that scripts block on style sheets when accessing layout properties, which would be possible if JavaScriptCore was made interruptible.