please fix @charset rule
public ParseTester() {
final Writer w = new OutputStreamWriter(System.out);
output_ = new Output(w, " ");
final File css = new File(String.format("%s%s%s%s%s", WidgetProvider.NEWS_PATH, File.separator, 5,File.separator,"main.css"));
System.out.println(css.getAbsolutePath());
testParsing(css);
}
public void testParsing(final File cssFile) {
try {
System.setProperty("org.w3c.css.sac.parser", PARSER);
final ParserFactory factory = new ParserFactory();
final Parser parser;
final Reader r = new FileReader(cssFile);
final InputSource is = new InputSource(r);
parser = factory.makeParser();
parser.setDocumentHandler(this);
parser.parseStyleSheet(is);
}
catch (final Exception e) {
e.printStackTrace();
}
}
tested on local copy http://worldoftanks.ru/static/3.10.0.1/common/css/main.css
null [2:1] Error in style sheet. (Invalid token "@charset". Was expecting one of: <eof>, , ".", ":", "*", "[", <hash>, "", "@import", "@page", "@media", "@font-face", <atkeyword>, <ident>.)</ident></atkeyword></hash></eof>
warning!!!!!!!!!!!
bug reproduced when css likely:
/ max 31 import files for IE /
@charset "utf-8";
when removed comment block (0 line) - parser work well
Anonymous
Diff:
Now fixed in SVN. Please try the latest snapshot build from sonatye and report back.
Last edit: RBRi 2013-05-15
No response, so i assume it is fixed.