radkovo / jStyleParser

jStyleParser is a CSS parser written in Java. It has its own application interface that is designed to allow an efficient CSS processing in Java and mapping the values to the Java data types. It parses CSS 2.1 style sheets into structures that can be efficiently assigned to DOM elements. It is intended be the primary CSS parser for the CSSBox library. While handling errors, it is user agent conforming according to the CSS specification.
http://cssbox.sourceforge.net/jstyleparser/
GNU Lesser General Public License v3.0
92 stars 49 forks source link

calc function #56

Open Nicasso opened 8 years ago

Nicasso commented 8 years ago

Hello,

I don't know if it is a bug or that the calc function is just not supported yet. But the calcfunction is not being parsed, if it is used, the whole rule set is ignored. It looks like it is the only function which is not working since functions like linear-gradient do work correct.

So this whole ruleset will be ignored. .background2 { width: calc(100% - 100px); background: linear-gradient(red,yellow,blue); }

And this one will work. .background2 { background: linear-gradient(red,yellow,blue); }

Regards, Nico

Nicasso commented 8 years ago

Same goes for the alpha function.

  filter: alpha(opacity=60);

This declaration will be ignored.

radkovo commented 8 years ago

Unfortunately, calc() is not supported yet and for the first look, it will require quite significant modifications in the value processing, since it can actually produce different value types (lengths, angles, integers, etc.) The filter: property would be probably easier to implement; however it seems to be quite an experimental technology at the moment.

radkovo commented 7 years ago

I know it has been a long time but finally, there is now an experimental support for calc() added in the master branch.