I have a CSSStyleSheet object, which I need to change at runtime. But the Implementation don't have a method like updateCSSRule(String selector, CSS CSSRule)
How can I do this? I hope anyone can help me.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a CSSStyleSheet object, which I need to change at runtime. But the Implementation don't have a method like updateCSSRule(String selector, CSS CSSRule)
How can I do this? I hope anyone can help me.
Thanks!
You can do something like:
getCSSRules() to get a CSSRuleList
determine the index of the rule you like to change inside this list
call deleteRule with the given index
insertRule
InsertRule requires the rule as string, but i guess it is simple to construct the string out of you selector and CSSRule.
The w3c.dom.css API is really old and seems to be a bit strange these days....
Hope this helps. If not please open a issue, maybe i can add some support for your case.
RBRi
--------------------------
WETATOR
Smart web application testing
http://www.wetator.org
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello at all,
i got following question.
I have a CSSStyleSheet object, which I need to change at runtime. But the Implementation don't have a method like updateCSSRule(String selector, CSS CSSRule)
How can I do this? I hope anyone can help me.
Thanks!
On Thu, 04 Feb 2016 08:45:51 +0000 Tim A wrote:
You can do something like:
InsertRule requires the rule as string, but i guess it is simple to construct the string out of you selector and CSSRule.
The w3c.dom.css API is really old and seems to be a bit strange these days....
Hope this helps. If not please open a issue, maybe i can add some support for your case.