Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Set CSS Parameter For DOM Tree Element. Exception.

75 views
Skip to first unread message

Ruslan

unread,
Mar 19, 2010, 12:24:32 PM3/19/10
to
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?

Thank you.

Zack Weinberg

unread,
Mar 19, 2010, 12:41:59 PM3/19/10
to Ruslan, dev-te...@lists.mozilla.org
Ruslan <ruslan.fay...@gmail.com> wrote:

The style object returned by getComputedStyle is read-only. You have
to modify the specified values instead.

zw

Ruslan

unread,
Mar 19, 2010, 5:47:14 PM3/19/10
to
On Mar 19, 5:41 pm, Zack Weinberg <zweinb...@mozilla.com> wrote:

How can I modify specified value?
Which Interface to use for that, if I would like to set "display" to
"none"?

Ruslan

unread,
Mar 19, 2010, 7:16:48 PM3/19/10
to
I can reformulate the question.
How can I change the CSS parameter for the particular element and have
the changes visible.

Thank you.

Zack Weinberg

unread,
Mar 19, 2010, 10:56:49 PM3/19/10
to Ruslan, dev-te...@lists.mozilla.org
Ruslan <ruslan.fay...@gmail.com> wrote:

Is there a reason you can't simply assign to
<element>.style.<parameter> ?

zw

Ruslan

unread,
Mar 20, 2010, 4:39:00 AM3/20/10
to
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?

Neil

unread,
Mar 20, 2010, 3:23:44 PM3/20/10
to
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.

Ruslan

unread,
Mar 23, 2010, 5:33:25 PM3/23/10
to

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.

I did not found solution.

0 new messages