- From: Julien Grand-Mourcel via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 24 Sep 2007 15:45:29 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer In directory hutz:/tmp/cvs-serv12655/org/w3c/css/parser/analyzer Modified Files: CssParserTokenManager.java CssParser.jj CssParser.java Log Message: Correcting some imperfection to fix bug reported here : http://lists.w3.org/Archives/Public/www-validator-css/2007Sep/0022.html http://lists.w3.org/Archives/Public/www-validator-css/2007Sep/0023.html Index: CssParserTokenManager.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParserTokenManager.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- CssParserTokenManager.java 13 Jul 2007 13:32:20 -0000 1.15 +++ CssParserTokenManager.java 24 Sep 2007 15:45:26 -0000 1.16 @@ -1,6 +1,5 @@ /* Generated By:JavaCC: Do not edit this line. CssParserTokenManager.java */ package org.w3c.css.parser.analyzer; - import java.io.InputStream; import java.util.Vector; import java.util.Enumeration; @@ -54,3903 +53,3985 @@ import org.w3c.css.selectors.attributes.AttributeSubstr; import org.w3c.css.selectors.attributes.AttributeSuffix; -public class CssParserTokenManager implements CssParserConstants { [...7854 lines suppressed...] + catch (java.io.IOException e1) { + EOFSeen = true; + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + if (curChar == '\n' || curChar == '\r') { + error_line++; + error_column = 0; + } + else + error_column++; + } + if (!EOFSeen) { + input_stream.backup(1); + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + } + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); + } + } +} } Index: CssParser.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- CssParser.java 13 Sep 2007 10:09:19 -0000 1.25 +++ CssParser.java 24 Sep 2007 15:45:26 -0000 1.26 @@ -57,4053 +57,3859 @@ import org.w3c.css.selectors.attributes.AttributeSuffix; /** - * A CSS3 parser - * + * A CSS3 parser + * * @author Philippe Le H???garet and Sijtsche Smeman * @version $Revision$ */ public abstract class CssParser implements CssParserConstants { [...7695 lines suppressed...] + if (p.next == null) { p = p.next = new JJCalls(); break; } + p = p.next; + } + p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; + } - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } + static final class JJCalls { + int gen; + Token first; + int arg; + JJCalls next; + } } Index: CssParser.jj =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- CssParser.jj 24 Sep 2007 11:18:47 -0000 1.22 +++ CssParser.jj 24 Sep 2007 15:45:26 -0000 1.23 @@ -1178,7 +1178,16 @@ ( LOOKAHEAD(2) comb=combinator() { if ("none".equals(ac.getProfile())) { - ac.getFrame().addWarning("nocomb"); + String[] warns = { String.valueOf(comb), ac.getMsg().getString(ac.getCssVersion()) }; + if (ac.getCssVersion().equals("css1") || + getAtRule().toString().equals("@media atsc-tv")) { + if (comb == '+') + ac.getFrame().addWarning("nocomb", warns); + else if (comb == '>') + ac.getFrame().addWarning("nocomb", warns); + } else if (!ac.getCssVersion().equals("css3") && comb == '~') { + ac.getFrame().addWarning("nocomb", warns); + } } else { if (ac.getProfile() != null) { if (ac.getProfile().equals("mobile") || @@ -1197,7 +1206,6 @@ if (comb == '~') throw new InvalidParamException("nocomb", "~", ac); } - } } switch(comb) { @@ -1513,7 +1521,14 @@ if (ac.getCssVersion().equals("css3")) { s.addPseudo(convertIdent(n.image).toLowerCase()); } else if ("none".equals(ac.getProfile())) { - ac.getFrame().addWarning("pseudo-element"); + String cssVersion = ac.getCssVersion(); + ac.setCssVersion("css3"); + try { + s.addPseudo(convertIdent(n.image).toLowerCase()); + } finally { + ac.setCssVersion(cssVersion); + ac.getFrame().addWarning("pseudo", new String[] { convertIdent(n.image).toLowerCase(), ac.getMsg().getString(ac.getCssVersion()) }); + } } else { if (true) throw new InvalidParamException("pseudo-element",
Received on Monday, 24 September 2007 15:45:44 UTC