WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
28956
script appended to HEAD during document load executes after window.onload
https://bugs.webkit.org/show_bug.cgi?id=28956
Summary
script appended to HEAD during document load executes after window.onload
Ojan Vafai
Reported
2009-09-03 14:00:10 PDT
In the attached test case, I append two script elements to the head element during document load and console.log the number of elements loaded as each script element loads and at window.onload. I get the following on the console: results.json Resource interpreted as script but transferred with MIME type text/html. race.html:21 Number of loaded results: 1 race.html:25 Number of results at window.onload: 1 results.json Resource interpreted as script but transferred with MIME type text/html. race.html:21 Number of loaded results: 2 The last script element gets executed after window.onload. Unless I'm crazy, all the script elements should be executed before the onload event fires, no? I think it might be a race condition that happens to get regularly triggered by the large size of the script files (~15MB), but that's just a guess. I tested this in a WebKit nightly and Safari 4 on the Mac. Both have the same behavior.
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2009-09-04 12:57:12 PDT
See also:
bug 28783
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug