This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24449 - Define when a StyleSheet is added to a StyleSheetList collection
Summary: Define when a StyleSheet is added to a StyleSheetList collection
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: CSSOM (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-30 15:33 UTC by Mike Taylor
Modified: 2014-01-30 15:33 UTC (History)
0 users

See Also:


Attachments

Description Mike Taylor 2014-01-30 15:33:18 UTC
Hi there,

[1] details a site compatibility issue reported by a Firefox for Android 
user. The main issue is that a site is relying on the presence of a 
style sheet in the style sheet collection to indicate that the 
stylesheet has been fully loaded (see [2]).

I wrote a simple test [3], and it seems that Firefox, Internet Explorer 
and Presto Opera all add the style sheet immediately to the 
document.styleSheets collection while Safari and Chrome (presumably 
others with WebKit heritage) wait for the load event (or thereabouts).

From my reading of [4], I would suspect that the non-WebKit behavior is 
correct, but perhaps there should be some language in the spec to clarify if a stylesheet should be added before or after it's loaded/parsed.

[1] <https://bugzilla.mozilla.org/show_bug.cgi?id=958415>
[2] 
<https://github.com/ameba-proteus/chikuwa.js/blob/master/chikuwa.js#L1067-L1068>
[3] <http://dhtml5.com/tmp/stylesheets-length.html>
[4] <http://dev.w3.org/csswg/cssom/#css-style-sheet-collections>