Re: Setting attributes via DOM does not take effect

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
[email protected] wrote:
> However, when I went further to access cssRules on the stylesheet, I
> got an error of 0x80004005.

That's NS_ERROR_FAILURE.  I just checked, and on the 1.8 branch the security 
check here always fails with that error code if there is no JSContext on 
XPConnect's stack.  That got rewritten to work correctly on trunk a while back.

You might be able to push a JSContext yourself, maybe (the one for the document 
in question).  Otherwise, you could go back to mutating the DOM, but instead of 
changing the text in the textnode add and remove text node kids under the 
<style>.  I think that works on branch...

-Bori
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.