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

Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer
In directory hutz:/tmp/cvs-serv26545/org/w3c/css/parser/analyzer

Modified Files:
	CssParser.java CssParser.jj 
Log Message:
Fixing bug  5623
http://www.w3.org/Bugs/Public/show_bug.cgi?id=5623

attribute selectors are not valid CSS1



Index: CssParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- CssParser.java	17 Feb 2009 11:38:52 -0000	1.60
+++ CssParser.java	17 Feb 2009 15:58:48 -0000	1.61
@@ -597,7 +597,7 @@
                 {if (true) return;}
             }
           // quite ugly but necessary to avoid probably a lot of changes in the
-          // grammar, still having a beatiful error message
+          // grammar, still having a beautiful error message
             else if (!reinited && ret.startsWith("@charset")) {
                 ParseException e =
                 new ParseException(ac.getMsg().getString("parser.charset"));
@@ -2547,6 +2547,14 @@
       ;
     }
     jj_consume_token(RBRACKET);
+          if ("css1".equals(ac.getCssVersion())) {
+              ParseException p;
+              p = new ParseException("attribute selectors are invalid "+
+                                     "in CSS1");
+              /* ParseException(ac.getMsg().getString("parser.attrcss1")) */
+              ac.getFrame().addError(new CssError(p));
+              removeThisRule();
+          }
           if (selectorType == CssSelectors.ATTRIBUTE_ANY) {
               try {
                   s.addAttribute(new AttributeAny(att.image.toLowerCase()));

Index: CssParser.jj
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- CssParser.jj	17 Feb 2009 11:38:52 -0000	1.60
+++ CssParser.jj	17 Feb 2009 15:58:48 -0000	1.61
@@ -712,7 +712,7 @@
 		return; 
 	    }
 	  // quite ugly but necessary to avoid probably a lot of changes in the
-	  // grammar, still having a beatiful error message
+	  // grammar, still having a beautiful error message
 	    else if (!reinited && ret.startsWith("@charset")) {
 		ParseException e = 
 		new ParseException(ac.getMsg().getString("parser.charset"));
@@ -1650,6 +1650,14 @@
 	   ( <S> )* ) )?
   <RBRACKET>
       {
+	  if ("css1".equals(ac.getCssVersion())) {
+	      ParseException p;
+	      p = new ParseException("attribute selectors are invalid "+
+				     "in CSS1");
+	      /* ParseException(ac.getMsg().getString("parser.attrcss1")) */
+	      ac.getFrame().addError(new CssError(p));
+	      removeThisRule();
+	  }
 	  if (selectorType == CssSelectors.ATTRIBUTE_ANY) {
 	      try {
 		  s.addAttribute(new AttributeAny(att.image.toLowerCase()));

Received on Tuesday, 17 February 2009 15:59:00 UTC