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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>56436</bug_id>
          
          <creation_ts>2011-03-15 17:47:59 -0700</creation_ts>
          <short_desc>Dynamically created &lt;style&gt; element does not fire load event as per HTML5 spec</short_desc>
          <delta_ts>2022-08-20 01:09:29 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</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="Scott Kyle">scottwkyle</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>dbates</cc>
    
    <cc>eric</cc>
    
    <cc>gavinp</cc>
    
    <cc>hyatt</cc>
    
    <cc>koivisto</cc>
    
    <cc>mihaip</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>tonyg</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>368097</commentid>
    <comment_count>0</comment_count>
    <who name="Scott Kyle">scottwkyle</who>
    <bug_when>2011-03-15 17:47:59 -0700</bug_when>
    <thetext>Below is taken from the spec (http://dev.w3.org/html5/spec/Overview.html#the-style-element):

&quot;Once the attempts to obtain the style sheet&apos;s critical subresources, if any, are complete, or, if the style sheet has no critical subresources, once the style sheet has been parsed and processed, the user agent must, if the loads were successful or there were none, queue a task to fire a simple event named load at the style element, or, if one of the style sheet&apos;s critical subresources failed to completely load for any reason (e.g. DNS error, HTTP 404 response, a connection being prematurely closed, unsupported Content-Type), queue a task to fire a simple event named error at the style element. Non-network errors in processing the style sheet or its subresources (e.g. CSS parse errors, PNG decoding errors) are not failures for the purposes of this paragraph.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>370824</commentid>
    <comment_count>1</comment_count>
    <who name="Gavin Peters">gavinp</who>
    <bug_when>2011-03-21 12:21:54 -0700</bug_when>
    <thetext>I have set aside time this week to peek at this.  Hopefully I&quot;ll have something soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>370849</commentid>
    <comment_count>2</comment_count>
    <who name="Tony Gentilcore">tonyg</who>
    <bug_when>2011-03-21 13:00:42 -0700</bug_when>
    <thetext>Loosely related are:
https://bugs.webkit.org/show_bug.cgi?id=38995
http://www.phpied.com/when-is-a-stylesheet-really-loaded/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539988</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-01-20 18:21:27 -0800</bug_when>
    <thetext>This reminds me of the recent work on link elements firing load events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1892605</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-19 23:32:52 -0700</bug_when>
    <thetext>Safari Technology Preview 151 seems to pass this test case:

https://wpt.fyi/results/html/semantics/document-metadata/the-style-element/style_load_event.html?label=master&amp;label=experimental&amp;aligned&amp;view=subtest&amp;q=style%20load%20event

Is something else needed here or I am looking at wrong test case? Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1892623</commentid>
    <comment_count>5</comment_count>
      <attachid>461755</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-08-20 01:09:19 -0700</bug_when>
    <thetext>Created attachment 461755
test case

This seems to be working now.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>461755</attachid>
            <date>2022-08-20 01:09:19 -0700</date>
            <delta_ts>2022-08-20 01:09:19 -0700</delta_ts>
            <desc>test case</desc>
            <filename>bug56436.html</filename>
            <type>text/html</type>
            <size>241</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8Ym9keT4KPGRpdiBpZD0icmVzdWx0Ij48L2Rpdj4KPHNj
cmlwdD4KCmNvbnN0IHN0eWxlID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3R5bGUnKTsKc3R5
bGUuYWRkRXZlbnRMaXN0ZW5lcignbG9hZCcsICgpID0+IHJlc3VsdC50ZXh0Q29udGVudCA9ICds
b2FkZWQnKTsKZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChzdHlsZSk7Cgo8L3NjcmlwdD4KPC9i
b2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>