W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2012

Re: [whatwg] HTMLLinkElement.disabled and HTMLLinkElement.sheet behavior

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 28 Aug 2012 06:12:39 +0000 (UTC)
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Message-ID: <Pine.LNX.4.64.1208280606160.28570@ps20323.dreamhostps.com>
Cc: whatwg@lists.whatwg.org
On Tue, 28 Aug 2012, Boris Zbarsky wrote:
> On 8/28/12 12:46 AM, Ian Hickson wrote:
> > I've updated the spec to not block on style sheets for nested parser's
> > scripts.
> 
> I'm not sure I follow.  What is not going to block on what with this change?
> 
> As far as I can tell, "0 1 2" in your testcase at
> http://damowmow.com/playground/demos/document-write-and-scripts/002.html is
> consistent with the following order of execution:
> 
> 1)  x=0
> 2)  x1=0,x=1 (nothing else has run yet because we're waiting on
>     blank.js)
> 3)  setTimeout fires, sets x2 = 1
> 3)  second external script runs, sets x = 2.

There's only one external script. The script after the style sheet is 
internal. If it blocks, you get "0 1 2" (when x2 gets set to x in the 
timeout, it's still x=1, because the next script, which sets x=2, hasn't 
run). In Gecko, however, that internal script doesn't block, and so the 
timeout runs after x has been set to 2. Hence "0 2 2".

The reason for having the external script in 002.html is that it causes 
document.write() to return right there (except in IE9, but that's another 
story, not sure what that's about), so you can tell the difference 
between how the internal <script> after the <link> is acting when it's 
tokenised in a nested tokeniser (001) or the top-level tokeniser (002).

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 28 August 2012 06:13:06 UTC

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