This is something we'd wanto implement in mozilla as we have time to but currently there are more important things to fix so I'll haveto mark this as Future for now, thanks for filing this tho! :-)
Taking QA Contact on all open or unverified DOM Style bugs...
Nominating this bug for nsbeta1 on behalf of firstname.lastname@example.org.
Removing nsbeta1 nomination -- there was a misunderstanding and some "approved out features" were nominated by mistake! Sorry!
I'm a glutton for punishment....
OK. So document.implementation.createCSSStyleSheet() is completely useless. From http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-DOMImplementationCSS: This interface allows the DOM user to create a CSSStyleSheet outside the context of a document. There is no way to associate the new CSSStyleSheet with a document in DOM Level 2. In other words, there is nothing useful you can do with the stylesheet it gives you. Daniel, this seems like something that the CSS WG should take a look at.... Either remove this or make it useful. ;) Creating a <style> element and appending it into the DOM will create a useful (attached to document) stylesheet in the meantime. Futuring, but please let me know if I'm missing something that makes this worth implementing in the near term.
No plans to work on this any time in the foreseeable future, so to default owner.
14 years ago
This would be indeed a usefull feature. Why does following assignment don't work? var styleSheet = document.implementation.createCSSStyleSheet("Test", "all"); document.styleSheets[document.styleSheets.length - 1] = styleSheet; Theoretically this should work or not?
No longer present in the specification: <http://dev.w3.org/csswg/cssom/> (In reply to comment #8) > This would be indeed a usefull feature. > > Why does following assignment don't work? > > var styleSheet = document.implementation.createCSSStyleSheet("Test", "all"); > document.styleSheets[document.styleSheets.length - 1] = styleSheet; > > Theoretically this should work or not? No, document.styleSheets[document.styleSheets.length - 1] can't be set.