Bug 56436

Summary: Dynamically created <style> element does not fire load event as per HTML5 spec
Product: WebKit Reporter: Scott Kyle <scottwkyle>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, dbates, eric, gavinp, hyatt, koivisto, mihaip, rniwa, simon.fraser, tonyg
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.6   
Attachments:
Description Flags
test case none

Scott Kyle
Reported 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."
Attachments
test case (241 bytes, text/html)
2022-08-20 01:09 PDT, Ryosuke Niwa
no flags
Gavin Peters
Comment 1 2011-03-21 12:21:54 PDT
I have set aside time this week to peek at this. Hopefully I"ll have something soon.
Eric Seidel (no email)
Comment 3 2012-01-20 18:21:27 PST
This reminds me of the recent work on link elements firing load events.
Ahmad Saleem
Comment 4 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!
Ryosuke Niwa
Comment 5 2022-08-20 01:09:19 PDT
Created attachment 461755 [details] test case This seems to be working now.
Note You need to log in before you can comment on or make changes to this bug.