xamde / wikimodel

Automatically exported from code.google.com/p/wikimodel
1 stars 0 forks source link

wikimodel's usage of cssparser breaks css4j #197

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use in the same project css4j and wikimodel.
2. Try to parse a stylesheet using css4j's document.addStyleSheet(new 
org.w3c.css.sac.InputSource(new StringReader(css)));

What is the expected output? What do you see instead?

Expected: The provided CSS is correctly parsed and applied on the document.
Result: No rules are detected in the parsed CSS.

What version of the product are you using? On what operating system?

Build from 21/10/2010: 
http://maven.xwiki.org/externals/org/wikimodel/org.wikimodel.wem/2.0.7-20101021/

Please provide any additional information below.

This is actually a bug in cssparser, but there's an easy workaround. Using the 
parameterless constructor of CSSOMParser sets the system provider for CSS 
parsers and instantiates a SACParserCSS2. This parser expects a DocumentHandler 
instance extending cssparser's DocumentHandlerExt class, rejecting any other 
handler, such as the one provided by batik-css. Calling the constructor that 
accepts a parser instance doesn't have this unwanted side effect, and even 
allows using a CSS 2.1 parser instead of the default CSS 2.0 one.

Original issue reported on code.google.com by sergiu.dumitriu on 27 Oct 2010 at 7:44

GoogleCodeExporter commented 9 years ago
Fix for this issue.

Original comment by sergiu.dumitriu on 27 Oct 2010 at 7:46

Attachments:

GoogleCodeExporter commented 9 years ago
Applied

Original comment by vmas...@gmail.com on 27 Oct 2010 at 8:09