<?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>29566</bug_id>
          
          <creation_ts>2016-04-08 13:07:11 +0000</creation_ts>
          <short_desc>Specify insertRule(&apos;@import ...&apos;, 0) loading</short_desc>
          <delta_ts>2016-04-08 14:51:38 +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="Simon Pieters">zcorpan</reporter>
          <assigned_to name="Simon Pieters">zcorpan</assigned_to>
          <cc>rune</cc>
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>125777</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2016-04-08 13:07:11 +0000</bug_when>
    <thetext>https://drafts.csswg.org/cssom/#the-cssimportrule-interface

[[
Note: If loading of the style sheet fails its CSS rules list is simply empty, i.e., an @import at-rule always has an associated CSS style sheet.
]]

Unclear what should happen for insertRule(&apos;@import url(...);&apos;, 0); on an already-loaded stylesheet, as in  http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4039

What happens with the parent sheet while it&apos;s loading?
What happens when the @imported sheet is half-way loaded?
What happens when accessing CSSImportRule#styleSheet during loading?

Ack rune</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125778</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2016-04-08 13:44:09 +0000</bug_when>
    <thetext>From rune:

&gt; what makes me uncertain is that the loading import blocks the main
&gt; sheet from being applied in when the @import is parsed as part of the
&gt; &lt;style&gt; element. You have three scenarios if you&apos;re inserting the
&gt; style element after you applied style to your document the first time
&gt; and there are no other sheets blocking.
&gt; 1. Insert &lt;style&gt;@import url; ...&lt;/style&gt;
&gt; 2. Insert &lt;style&gt;...&lt;/style&gt;, insert @import
&gt; 3. Insert &lt;style&gt;...&lt;/style&gt;, re-apply style, insert @import
&gt; for the first case, the loading @import blocks application of the rest
&gt; of the &lt;style&gt; element. Gecko and Blink agrees on that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125779</commentid>
    <comment_count>2</comment_count>
    <who name="Rune Lillesveen">rune</who>
    <bug_when>2016-04-08 14:51:38 +0000</bug_when>
    <thetext>Inserting a style element with script and then insertRule() a slow loading @import will currently apply the main style of the style element in both Gecko and Blink before the @import finishes loading.

If you insert two @import rules, Gecko will apply them separately as they finish loading, but Blink will currently block until both sheets are loaded.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>