Re: How do we find which are the pending style sheets ?

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
biju wrote:
> There are situation where in JS code we need to know the height/width
> CSS value set using linked/imported style sheet. If it takes some time
> to load the style sheets, using JS code how do we find which are the
> style sheets that have not completed loading/parsing?

If your JS code is linked in via a <script> element, then by the time that 
<script> executes, all the stylesheets that had started loading before the 
parser got to that <script> will be loaded.

The point of the change in bug 84582 was to not have sites try to answer that 
question...

Now for the site in question 
(http://extjs.com/deploy/dev/examples/desktop/desktop.html), the <link> for the 
last stylesheet comes _after_ all the scripts.  So it's possible for some events 
(especially DOMContentLoaded) to execute before the stylesheet loads.  I'm not 
going to dig through those scripts right now, but that's my best guess for 
what's going on: the site is running code that wants layout information from 
DOMContentLoaded instead of onload...

-Boris


> 
> PS: I think this is the reason for regression
> https://bugzilla.mozilla.org/show_bug.cgi?id=404551#c6
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.