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

Post here questions and problems related to oXygen frameworks/document types.
Johann
Posts: 198
Joined: Wed Jun 17, 2015 12:46 pm

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

Post 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
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

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

Post 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
Johann
Posts: 198
Joined: Wed Jun 17, 2015 12:46 pm

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

Post by Johann »

Hey !

Thank you both for this information !

Regards,

Johann
Post Reply