Created attachment 45598 [details]
test case - inline script which adds a script tag
If a script inserts another script tag having a src attribute through a DOM appendChild call, that second script will not run until after the document load event has fired, and after other scripts in the HEAD or BODY have executed.
This deviates from Firefox 3.5 behaviour. I suspect it may also conflict with the WHATWG draft  which seems to require that a script must be run synchronously when its script element is inserted.
See the attached test case, in which an inline script inserts another script tag for an external file. Running the test case in Chrome 4.0.266.0 (WebKit 532.6) or Arora 0.10.1 (WebKit 532.4) on Linux gives this console output:
inline HEAD 2
We can see that the "a executed" output from the external script was deferred to the end, although the script was added at "adding script".
In contrast, Firefox 3.5 Linux gives this order:
inline HEAD 2
(Another amusing fact is that the picture changes if the external script is inserted with document.write instead of the DOM method. In that case, WebKit behaves identically to Firefox. I have a bunch of different test cases for various other ways of nesting the script inclusions.)
Created attachment 45600 [details]
the external script (one-liner) referenced by the test case
*** This bug has been marked as a duplicate of bug 28783 ***