css4j / echosvg

SVG implementation in the Java™ Language, fork of Apache Batik, supporting level 4 selectors and colors.
Apache License 2.0
40 stars 2 forks source link

Recover gracefully from unsupported CSS rules #57

Closed carlosame closed 2 years ago

carlosame commented 2 years ago

CSS Syntax Module Level 3, paragraph 2.2 says:

When errors occur in CSS, the parser attempts to recover gracefully, throwing away only the minimum amount of content before returning to parsing as normal. This is because errors aren’t always mistakes—new syntax looks like an error to an old parser, and it’s useful to be able to add new syntax to the language without worrying about stylesheets that include it being completely broken in older UAs.

EchoSVG's current behaviour is to throw an exception and stop CSS processing when an unsupported rule is found. This should be changed to match what the spec recommends.