W3C home > Mailing lists > Public > public-html@w3.org > July 2009

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

From: Maciej Stachowiak <mjs@apple.com>
Date: Fri, 24 Jul 2009 00:31:26 -0700
Cc: Travis Leithead <travil@microsoft.com>, "public-html@w3.org" <public-html@w3.org>, Jacob Rossi <t-jacobr@microsoft.com>, Kirk Sykora <ksykora@microsoft.com>, Harley Rosnow <Harley.Rosnow@microsoft.com>
Message-id: <DCE03DBA-1359-44FB-A14B-9EBB6A5478A6@apple.com>
To: Boris Zbarsky <bzbarsky@mit.edu>

On Jul 23, 2009, at 8:02 PM, Boris Zbarsky wrote:

> Travis Leithead wrote:
>> Thanks for that clarification. I'm curious what web compatibility  
>> issues motivated the change? Any pointers?
> I think http://webkit.org/blog/66/the-fouc-problem/ has a decent  
> summary of the problem and some of the possible solutions for it,  
> including the sorts of issues that Webkit was having with the "Don't  
> Stall" behavior (and which presumably led them to switch to their  
> current behavior).  It also describes the problems with the "Stall"  
> behavior Gecko used to have; those are not in terms of web compat  
> but in terms of performance.  There were also some internal  
> simplifications that were allowed by not stalling.
> Now that Gecko has reasonable speculative parsing and resource  
> prefetch, we might reevaluate returning to the "Stall" behavior at  
> some point; we've had a few reports of FOUC-type issues with our  
> current setup in some edge cases.  It hasn't been a major issue,  
> though, so chances are we won't be changing our behavior here.

Two particular things led us to change:

1) A popular third-party advertising script embedded in many Web pages  
would cause serious bad layout due to FOUC-type issues. This was  
actually more than just a flash of unstyled content, because the  
script counted on computed styles to do some sizing and positioning,  
and that ended up stuck wrong if stylesheets hadn't been loaded.

2) We added speculative parsing and preloading, which greatly reduced  
the performance cost of the "wait for stylesheets on script" model. In  
fact, we didn't see a measurable cost any more.

We're unlikely at this point to change to a full stall model,  
especially with Gecko converging on basically the same behavior.

Received on Friday, 24 July 2009 07:32:13 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:48 UTC