I have an exception during trying to change computed CSS parameter in xulrunner (v. 1.9.1.7).
I use an instance of the class nsIDOMCSSStyleDeclaration for accessing css parameters. By calling its function member setProperty("display", "none", "important") I get an exception: The function "setProperty" returned an error condition (0x80530007), it's textual representation is NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR.
Why i get this error and how to change css parameter for particular element?
Ruslan <ruslan.fayzrakhma...@gmail.com> wrote: > I have an exception during trying to change computed CSS parameter in > xulrunner (v. 1.9.1.7).
> I use an instance of the class nsIDOMCSSStyleDeclaration for accessing > css parameters. > By calling its function member setProperty("display", "none", > "important") I get an exception: > The function "setProperty" returned an error condition (0x80530007), > it's textual representation is > NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR.
> Why i get this error and how to change css parameter for particular > element?
The style object returned by getComputedStyle is read-only. You have to modify the specified values instead.
> Ruslan <ruslan.fayzrakhma...@gmail.com> wrote: > > I have an exception during trying to change computed CSS parameter in > > xulrunner (v. 1.9.1.7).
> > I use an instance of the class nsIDOMCSSStyleDeclaration for accessing > > css parameters. > > By calling its function member setProperty("display", "none", > > "important") I get an exception: > > The function "setProperty" returned an error condition (0x80530007), > > it's textual representation is > > NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR.
> > Why i get this error and how to change css parameter for particular > > element?
> The style object returned by getComputedStyle is read-only. You have > to modify the specified values instead.
> zw
How can I modify specified value? Which Interface to use for that, if I would like to set "display" to "none"?
Ruslan <ruslan.fayzrakhma...@gmail.com> wrote: > I can reformulate the question. > How can I change the CSS parameter for the particular element and have > the changes visible.
Is there a reason you can't simply assign to <element>.style.<parameter> ?
My programming language is Java. I use javaxpcom to have an access to xpcom. Actually I can use only those interfaces. And unfortunately I can not follow your suggestion.
Do you know any interfaces for that? Or is it possible for example (in case if I can not change css) to set anattribute for the element and ask xulrunner to recalculate css and redraw this particular element, or all DOM tree elements?
Ruslan wrote: >My programming language is Java. I use javaxpcom to have an access to xpcom. Actually I can use only those interfaces. And unfortunately I can not follow your suggestion.
On Mar 20, 8:23 pm, Neil <n...@parkwaycc.co.uk> wrote:
> Ruslan wrote: > >My programming language is Java. I use javaxpcom to have an access to xpcom. Actually I can use only those interfaces. And unfortunately I can not follow your suggestion.
> >Do you know any interfaces for that?
> Start with nsIDOMElementCSSInlineStyle perhaps?
> -- > Warning: May contain traces of nuts.
It is not the solution: 1. You can get this interface only if the element has attribute "style". 2. Mozilla do not redraw/recompute the CSS.