Re: Setting attributes via DOM does not take effect

"[email protected]" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Organization http://groups.google.com
Message-ID <[email protected]>
On Jan 9, 10:44 pm, Boris Zbarsky <[email protected]> wrote:
> [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

Big thanks! Replacing the node instead of updating the node value
worked with 1.8 branch.

I had also been busy with embedding trunk 1.9 and finally got it to
work a few minutes back. Trunk 1.9 works with my original route of
updating css node value, as you pointed out earlier. 1.9 also works
with the nsIDOMCSSRule/nsIDOMCSSStyleRule interfaces, no error was
thrown. I will probably go with 1.9 since DOMCSS stuff offer much
granular control. Hope 1.9 will be released soon.

Thank you for bearing with me and clarifying the mystery for me. You
are super. This group is really helpful.
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.