W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2011

[whatwg] HTMLLinkElement.disabled and HTMLLinkElement.sheet behavior

From: Henri Sivonen <hsivonen@iki.fi>
Date: Wed, 5 Oct 2011 10:18:43 +0300
Message-ID: <CAJQvAue-GKXOq4KzF4iiVUUBXUAw6qZjmJ15E8Cn=ayFb7JHhQ@mail.gmail.com>
On Tue, Oct 4, 2011 at 9:54 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:
> What Firefox does do is block execution of <script> tags (but not timeouts,
> callbacks, etc!) if there are pending non-altenate parser-inserted
> stylesheet loads. ?This is necessary to make sure that scripts getting
> layout properties see the effect of those stylesheets. A side-effect is that
> a <script> coming after a <link> will never see the link in an unloaded
> state... unless there's a network error for the <link> or whatever.

One exception: If an inline script comes from document.write(), it
doesn't block on pending sheets. It runs right away. If it blocked on
pending sheets, the point at which document.write() returns would
depend on network performance, which I think would be worse than
having document.written inline scripts that poke at styles fail
depending on network performance.

For Web authors: Don't poke at styles from a document.written inline script.

-- 
Henri Sivonen
hsivonen at iki.fi
http://hsivonen.iki.fi/
Received on Wednesday, 5 October 2011 00:18:43 UTC

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