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.
The third change discussed in this comment: splitting PseudoPage, which was used for all pseudo-classes and -elements, into dedicated classes for each use. I settled on three:
PseudoPage, for the pseudo-classes that modify @page rules,
PseudoClass, for all other pseudo-classes, and
PseudoElement, for pseudo-elements.
This also meant splitting PseudoDeclaration into three: PseudoPageType, PseudoClassType, and PseudoElementType, and picking the right type for each use. As far as I can tell, each use of PseudoDeclaration referred to exactly one of the new types, meaning the references are more specific now.
I'm not sure if I implemented the matches methods correctly (I left some TODO comments in the code there), but all the tests pass.
The third change discussed in this comment: splitting
PseudoPage
, which was used for all pseudo-classes and -elements, into dedicated classes for each use. I settled on three:PseudoPage
, for the pseudo-classes that modify@page
rules,PseudoClass
, for all other pseudo-classes, andPseudoElement
, for pseudo-elements.This also meant splitting
PseudoDeclaration
into three:PseudoPageType
,PseudoClassType
, andPseudoElementType
, and picking the right type for each use. As far as I can tell, each use ofPseudoDeclaration
referred to exactly one of the new types, meaning the references are more specific now.I'm not sure if I implemented the
matches
methods correctly (I left someTODO
comments in the code there), but all the tests pass.