Bug 23278
Summary: | Implement document.createStyleSheet() | ||
---|---|---|---|
Product: | WebKit | Reporter: | Antoine Quint <ml> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, rniwa |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 |
Antoine Quint
Currently, WebKit already supports the creation of a CSSStyleSheet by calling document.implementation.createCSSStyleSheet(), which is the DOM standard way to do it. However, once a CSSStyleSheet is created, there is no way to associate it with a document. StyleSheetList is read-only, and the create CSSStyleSheet has no .href that could be used to insert a <link> or @import rule in the document.
Internet Explorer has an extension that would solve this, with the document.createStyleSheet() method
http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
I think this is replaced by CSSStyleSheet:
https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet
It was IE specific and it was removed in IE11:
https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/dev-guides/bg182625(v=vs.85)?redirectedfrom=MSDN
Further, I took a sample from Internet and changed it into JSFiddle:
https://jsfiddle.net/qoLf5yme/
All browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6) show "document.createStyleSheet is not a function". I am going to mark this as "RESOLVED WONTFIX". Thanks!