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

reject width and height when they are negative #47

Closed hrj closed 8 years ago

hrj commented 8 years ago

A few more tests that check for invalid CSS, such as:

div {
    background: red;
    height: 1in;
    width: 0;
    width: -1px;
}

Here, the node-data should show a width of 0, instead of -1px.

Tests affected:

hrj commented 8 years ago

Other examples of invalid width / height: -1pt, -1%.

Tests:

radkovo commented 8 years ago

This should be fixed now. There were several related issues in DeclarationTransformer; I have reworked this part quite significantly. Now, the related code should be more clear and easier to debug.

hrj commented 8 years ago

Confirmed! There were 58 progressions and no regressions in the tests. Thanks!