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

[whatwg] scripts, defer, document.write and DOMContentLoaded

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 20 Jul 2009 22:30:28 -0400
Message-ID: <4A652844.1000804@mit.edu>
Ian Hickson wrote:
> Actually what's going on is more subtle than that. When you set innerHTML, 
> it's actually triggering the deferred scripts right there, if it has them 
> loaded (e.g. inline scripts or cached scripts). If it doesn't have them 
> loaded yet, it drops them on the floor and doesn't ever run them.
> 
> I've specced this, except that the spec requires that not-yet-loaded 
> scripts be loaded then run, rather than dropped, before innerHTML 
> continues, so there's no race conditions.

Er... wait.  So innerHTML has to block on network access?  And possibly 
spin the event loop as it does so?

This doesn't seem desirable to me.... Why do we want this behavior?

-Boris
Received on Monday, 20 July 2009 19:30:28 UTC

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