Page 1 of 1

ro.sync.ecss.css.Styles getPseudoLevel() only returns 0 or 1

Posted: Fri Mar 04, 2016 6:08 pm
by Johann
Hello everyone,

I am using the author component (SDK version 17.1.0.1). I have created a class which implements ro.sync.ecss.extensions.api.StylesFilter.
My .framework file calls this class in the "cssStylesFilterExtension" field.

My .framework file also calls a CSS file containing several pseudo elements at different pseudo levels. Example :

Code: Select all

procedure:before(1) {
content: "before 1";
background-color: red;
}
procedure:before(2) {
content: "before 2";
background-color: green;
}
procedure:before(3) {
content: "before 3";
background-color: blue;
}
When I open my XML file, I can see that the different contents and styles have been applied.

I would like to change programmatically in my "StylesFilter" class the styles of these pseudo elements so I tried to get the pseudoLevel of the current styles by using :

Code: Select all

styles.getPseudoLevel()
BUT it always returns 0 or 1 for all type of nodes (NODE_TYPE_PSEUDO_ELEMENT or NODE_TYPE_ELEMENT).

Can you help me on this ?

Thanks.

Johann

Re: ro.sync.ecss.css.Styles getPseudoLevel() only returns 0 or 1

Posted: Mon Mar 07, 2016 10:53 am
by Radu
Hi Johann,

Indeed this is a limitation of the current API. I will add an issue to see if we can remove it in a future version, possibly in Oxygen 18 and possibly by adding a special interface to call for such levels.

Regards,
Radu

Re: ro.sync.ecss.css.Styles getPseudoLevel() only returns 0 or 1

Posted: Tue Mar 08, 2016 11:41 am
by Dan
Hi Johann,

We changed the way the StylesFilter.filter() gets called for pseudo elements.
Now it works also for higher level pseudo elements but only if they have been defined in the CSS (i.e. they have a 'content' property). You can change this content from the filter method. The level is accessible through Styles.getPseudoLevel()

This will be available in the next Oxygen version (v18).

Best regards,
Dan

Re: ro.sync.ecss.css.Styles getPseudoLevel() only returns 0 or 1

Posted: Tue Mar 08, 2016 11:46 am
by Johann
Hey !

Thank you both for this information !

Regards,

Johann