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

[feature request] support for getting short form version #38

Open hrj opened 9 years ago

hrj commented 9 years ago

I am not sure if this needs to be in jStyleParser; but it seems relevant. Would like to know your thoughts on this. Thanks!


The CSS DOM API allows querying the short hand form of a property, even when it is not directly specified. There are two types of behaviour:

  1. In JS, element.style.background returns the background as specified in the style attribute.
  2. In JS, getComputedStyle(element).background returns the short form of the computed background, even if only long forms are specified.

It would be nice to have some support for this from jStyleParser (in the form of static utility methods). The wiring to JS land can be done on the client side of course.