W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2009

2002/css-validator/org/w3c/css/parser/analyzer CssParser.java,1.61,1.62

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 17 Feb 2009 16:55:07 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1LZTDv-00034m-73@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer
In directory hutz:/tmp/cvs-serv11738/org/w3c/css/parser/analyzer

Modified Files:
	CssParser.java 
Log Message:
generated

Index: CssParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- CssParser.java	17 Feb 2009 15:58:48 -0000	1.61
+++ CssParser.java	17 Feb 2009 16:55:05 -0000	1.62
@@ -510,9 +510,8 @@
                                   ac.getMsg().getString("parser.charset"));}
                 }
                 if ("css1".equals(ac.getCssVersion())) {
-                    {if (true) throw new ParseException("No @charset rule is allowed "+
-                                             "in CSS1");}
-                    /* ac.getMsg().getString("parser.charsetcss1") */
+                    {if (true) throw new ParseException(ac.getMsg().getString(
+                                                         "parser.charsetcss1"));}
                 }
                 // stricter rule for CSS21 and soon for CSS3
                 if ("css21".equals(ac.getCssVersion())) {
@@ -2548,11 +2547,21 @@
     }
     jj_consume_token(RBRACKET);
           if ("css1".equals(ac.getCssVersion())) {
+              StringBuilder reason;
+              CssParseException cp;
               ParseException p;
-              p = new ParseException("attribute selectors are invalid "+
-                                     "in CSS1");
-              /* ParseException(ac.getMsg().getString("parser.attrcss1")) */
-              ac.getFrame().addError(new CssError(p));
+              reason = new StringBuilder(" [");
+              if (att != null) {
+                  reason.append(convertIdent(att.image));
+              }
+              if (val != null ) {
+                  reason.append('=').append(val.image);
+              }
+              reason.append(']');
+              p = new ParseException(ac.getMsg().getString("parser.attrcss1")+
+                                     reason.toString());
+              cp = new CssParseException(p);
+              ac.getFrame().addError(new CssError(cp));
               removeThisRule();
           }
           if (selectorType == CssSelectors.ATTRIBUTE_ANY) {
Received on Tuesday, 17 February 2009 16:55:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:08 GMT