Bug 56436 - Dynamically created <style> element does not fire load event as per HTML5 spec
Summary: Dynamically created <style> element does not fire load event as per HTML5 spec
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.6
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-15 17:47 PDT by Scott Kyle
Modified: 2022-08-20 01:09 PDT (History)
12 users (show)

See Also:


Attachments
test case (241 bytes, text/html)
2022-08-20 01:09 PDT, Ryosuke Niwa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Kyle 2011-03-15 17:47:59 PDT
Below is taken from the spec (http://dev.w3.org/html5/spec/Overview.html#the-style-element):

"Once the attempts to obtain the style sheet'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'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."
Comment 1 Gavin Peters 2011-03-21 12:21:54 PDT
I have set aside time this week to peek at this.  Hopefully I"ll have something soon.
Comment 3 Eric Seidel (no email) 2012-01-20 18:21:27 PST
This reminds me of the recent work on link elements firing load events.
Comment 4 Ahmad Saleem 2022-08-19 23:32:52 PDT
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&label=experimental&aligned&view=subtest&q=style%20load%20event

Is something else needed here or I am looking at wrong test case? Thanks!
Comment 5 Ryosuke Niwa 2022-08-20 01:09:19 PDT
Created attachment 461755 [details]
test case

This seems to be working now.