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

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

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 21 Jul 2009 00:32:55 -0700
Message-ID: <73AB10F0-DE22-46BD-85D1-D121A344C435@apple.com>

On Jul 20, 2009, at 7:30 PM, Boris Zbarsky wrote:

> 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?

innerHTML blocking on network access seems seriously problematic to  
me. I don't think blocking the UI is preferable to a race condition,  
when we are talking about a compatibility quirk for content doing  
something dubious.

Regards,
Maciej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090721/906416c4/attachment.htm>
Received on Tuesday, 21 July 2009 00:32:55 UTC

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