Menu

#39 Charset bug CSS21

0.9.8
closed
RBRi
charset (1)
1
2015-07-25
2013-03-27
No

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>, <S>, ".", ":", "*", "[", <HASH>, "", "@import", "@page", "@media", "@font-face", <ATKEYWORD>, <IDENT>.)

warning!!!!!!!!!!!
bug reproduced when css likely:

/ max 31 import files for IE /
@charset "utf-8";

when removed comment block (0 line) - parser work well

Discussion

  • Dima Korniets

    Dima Korniets - 2013-03-27
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -41,3 +41,11 @@
     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>, <S>, ".", ":", "*", "[", <HASH>, "<!--", "-->", "@import", "@page", "@media", "@font-face", <ATKEYWORD>, <IDENT>.)
    +
    +warning!!!!!!!!!!!
    +bug reproduced when css likely:
    +
    +/* max 31 import files for IE */
    +@charset "utf-8";
    +
    +when removed comment block (0 line) - parser work well
    
     
  • RBRi

    RBRi - 2013-05-15

    Now fixed in SVN. Please try the latest snapshot build from sonatye and report back.

     

    Last edit: RBRi 2013-05-15
  • RBRi

    RBRi - 2013-05-15
    • status: accepted --> pending
     
  • RBRi

    RBRi - 2013-06-14
    • status: pending --> closed
     
  • RBRi

    RBRi - 2013-06-14

    No response, so i assume it is fixed.

     
  • RBRi

    RBRi - 2015-07-25
    • assigned_to: RBRi
     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.