[whatwg] Async scripts

Ian Hickson ian at hixie.ch
Thu Oct 8 21:46:45 PDT 2009


On Wed, 30 Sep 2009, Jonas Sicking wrote:
>
> There's two things that I don't understand about the 'async' attribute 
> on <script> elements:
> 
> First of all, why is the parser responsible for executing scripts on the 
> "list of scripts that will execute asynchronously", as defined by [1]? 
> It would seem simpler to always perform the steps defined further down, 
> no matter if the document is still being parsed or not.

This was written before the event loop mechanism existed, so at the time 
it was the only way to define how it interacted with parsing.

I've fixed it.


> Second, why are async scripts forced to run in the order they appear in 
> the markup? I thought the whole idea of the async attribute was to run 
> the scripts as soon as possible, while still not blocking parsing.

I was trying to be conservative, I think.

I've changed it to just be truely async. People can always detect whether 
all their scripts have finished loading if the order truly matters.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list