[whatwg] HTMLLinkElement.disabled and HTMLLinkElement.sheet behavior

Julien Chaffraix julien.chaffraix at gmail.com
Tue Oct 4 14:43:02 PDT 2011


>> * However, FF loads the stylesheet synchronously whereas Opera does it
>> asynchronously from a JS perspective
>
> Uh...  Firefox does not load anything synchronously.
>
> 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.

Thanks for the explanation. I took a black-box approach in testing - I
don't pretend to know how Firefox works - and from that perspective,
it looked like it was synchronous as the |sheet| was present and
properly populated in JS.

>> * Some websites (4chan.org for examples) assumes that the |sheet| is
>> always available and that |disabled| will work properly regardless of
>> when it is called.
>
> OK.  That behavior is allowed by the spec as far as I can tell.

It is. However the specification states that |disabled| would be
ignored if there is no |sheet|. It looks like web-authors don't factor
this into their code.

>> We ended up reverting our changes due to incompatibilities seen in the
>> wild and seek the spec amended before resuming our implementation in a
>> compatible manner.
>
> What specific changes do you want to the spec?  As far as I can tell, right
> now the spec says nothing about when sheets become associated and that this
> would need to be defined, right?  Anything else?

I think you pinpointed the problem here: defining when the association
occurs (and also when none will happen) would remove the issue that we
see.

Thanks,
Julien



More information about the whatwg mailing list