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

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

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 17 Feb 2009 11:38:54 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1LZOHu-0006G1-Vj@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer
In directory hutz:/tmp/cvs-serv24020/org/w3c/css/parser/analyzer

Modified Files:
	CssParser.jj CssParser.java 
Log Message:
CSS1 now reports an error when @charset is present.
TODO localisation of the error message
Fixes http://www.w3.org/Bugs/Public/show_bug.cgi?id=5582



Index: CssParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- CssParser.java	16 Feb 2009 17:59:23 -0000	1.59
+++ CssParser.java	17 Feb 2009 11:38:52 -0000	1.60
@@ -509,6 +509,11 @@
                     {if (true) throw new ParseException(
                                   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") */
+                }
                 // stricter rule for CSS21 and soon for CSS3
                 if ("css21".equals(ac.getCssVersion())) {
                     // single space before

Index: CssParser.jj
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- CssParser.jj	16 Feb 2009 17:59:13 -0000	1.59
+++ CssParser.jj	17 Feb 2009 11:38:52 -0000	1.60
@@ -665,6 +665,11 @@
 		    throw new ParseException(
 				  ac.getMsg().getString("parser.charset"));
 		}
+		if ("css1".equals(ac.getCssVersion())) {
+		    throw new ParseException("No @charset rule is allowed "+
+					     "in CSS1");
+		    /* ac.getMsg().getString("parser.charsetcss1") */
+		}
 	        // stricter rule for CSS21 and soon for CSS3
 		if ("css21".equals(ac.getCssVersion())) {
 		    // single space before
Received on Tuesday, 17 February 2009 11:39:06 GMT

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