W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

[whatwg] Async scripts

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 9 Oct 2009 04:46:45 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0910090408420.25383@hixie.dreamhostps.com>
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.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 8 October 2009 21:46:45 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:17 UTC