W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2010

[whatwg] comments on SCRIPT ASYNC and DEFER

From: Henri Sivonen <hsivonen@iki.fi>
Date: Wed, 10 Feb 2010 11:31:16 +0200
Message-ID: <A868AE89-F85C-4A6D-9B1B-653E1D7E769D@iki.fi>
On Feb 8, 2010, at 23:54, Steve Souders wrote:

> It would be good to mention this optional behavior here, something along the lines of browsers may want to do speculative parsing, but shouldn't create DOM elements, etc. - only kickoff HTTP requests.

FWIW, the HTML5 parser in Gecko (not on by default yet) does more than just kicks off HTTP requests. However, what it does isn't supposed to be detectable by author-supplied scripts.

> 4. "If the element has a src attribute, [snip] the specified resource must then be fetched, from the origin of the element's Document."
>     If the script has DEFER, the request should not start until after parsing is finished. Starting it earlier could block other (non-deferred) requests due to a connection limit or limited bandwidth.

As I understand it, starting the request early is the whole point of 'defer'. Otherwise, the author could put those scripts at the end of the page.

-- 
Henri Sivonen
hsivonen at iki.fi
http://hsivonen.iki.fi/
Received on Wednesday, 10 February 2010 01:31:16 UTC

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