Re: [HTML5] DOMContentLoaded fires before CSS resources loaded?

On Mon, 3 Aug 2009, Boris Zbarsky wrote:
> Ian Hickson wrote:
> > On Wed, 22 Jul 2009, Maciej Stachowiak wrote:
> > > [...] if we encounter a <script> element while a stylesheet load is 
> > > pending, we block parsing until the stylesheet is loaded. We used to 
> > > not do that, but it turned out to be necessary for Web 
> > > compatibility.
> > 
> > On Wed, 22 Jul 2009, Boris Zbarsky wrote:
> > > This is precisely what Gecko does [...]
> > 
> > Gecko and WebKit do quite different things here, actually.
> 
> In the absence of <script> elements created via DOM calls?  What are the 
> differences?

Differences based on whether the scripts are internal or external, on 
whether scripts are inserted dynamically or not, etc.


> > I ended up speccing the Gecko behaviour, because it is much simpler 
> > (block on running any script if a style sheet is pending)
> 
> That would be running any newly-added <script>, not running script in 
> general, right?

Right.


> And pending has a somewhat nontrivial definition as well... (a 
> stylesheet added via parsing a <link> or <style> element that was in the 
> currently selected stylesheet set at the point when it was added to the 
> DOM and is either not done loading or has an @import'ed descendant that 
> is not done loading).

I just said "applicable style sheets". Right now it's hard to be more 
detailed since CSSOM isn't stable, so all this stuff isn't well-defined 
yet.


> I'd really appreciate a pointer to the relevant spec section.

http://www.whatwg.org/specs/web-apps/current-work/#executing-a-script-block

Step 2.

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

Received on Wednesday, 12 August 2009 23:25:52 UTC