<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>24449</bug_id>
          
          <creation_ts>2014-01-30 15:33:18 +0000</creation_ts>
          <short_desc>Define when a StyleSheet is added to a StyleSheetList collection</short_desc>
          <delta_ts>2014-01-30 15:33:18 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>CSSOM</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mike Taylor">miketaylr</reporter>
          <assigned_to name="Simon Pieters">zcorpan</assigned_to>
          
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>99478</commentid>
    <comment_count>0</comment_count>
    <who name="Mike Taylor">miketaylr</who>
    <bug_when>2014-01-30 15:33:18 +0000</bug_when>
    <thetext>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&apos;s loaded/parsed.

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

    </bug>

</bugzilla>