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

Improved pseudo #87

Closed Mangara closed 6 years ago

Mangara commented 6 years ago

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:

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.

radkovo commented 6 years ago

Nice job! Many thanks.