W3C home > Mailing lists > Public > www-validator-cvs@w3.org > October 2012

2002/css-validator/org/w3c/css/parser/analyzer CssParser.java,1.84,1.85 CssParser.jj,1.83,1.84 CssParserTokenManager.java,1.44,1.45

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 04 Oct 2012 13:16:52 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1TJlIK-00011G-L2@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer
In directory hutz:/tmp/cvs-serv3832

Modified Files:
	CssParser.java CssParser.jj CssParserTokenManager.java 
Log Message:
step 1 of vendorext for values

Index: CssParserTokenManager.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParserTokenManager.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- CssParserTokenManager.java	6 Sep 2012 12:37:53 -0000	1.44
+++ CssParserTokenManager.java	4 Oct 2012 13:16:50 -0000	1.45
@@ -6,7 +6,9 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.net.URL;
+import java.math.BigDecimal;
 import org.w3c.css.values.CssValue;
+import org.w3c.css.values.CssCheckableValue;
 import org.w3c.css.values.CssExpression;
 import org.w3c.css.values.CssString;
 import org.w3c.css.values.CssURL;
@@ -23,6 +25,7 @@
 import org.w3c.css.values.CssUnicodeRange;
[...5048 lines suppressed...]
@@ -6168,8 +6203,8 @@
    0x2L, 0x0L, 
 };
 protected SimpleCharStream input_stream;
-private final int[] jjrounds = new int[750];
-private final int[] jjstateSet = new int[1500];
+private final int[] jjrounds = new int[758];
+private final int[] jjstateSet = new int[1516];
 protected char curChar;
 /** Constructor. */
 public CssParserTokenManager(SimpleCharStream stream){
@@ -6196,7 +6231,7 @@
 {
    int i;
    jjround = 0x80000001;
-   for (i = 750; i-- > 0;)
+   for (i = 758; i-- > 0;)
       jjrounds[i] = 0x80000000;
 }
 

Index: CssParser.jj
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- CssParser.jj	6 Sep 2012 12:37:53 -0000	1.83
+++ CssParser.jj	4 Oct 2012 13:16:50 -0000	1.84
@@ -27,8 +27,10 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.net.URL;
+import java.math.BigDecimal;
 
 import org.w3c.css.values.CssValue;
+import org.w3c.css.values.CssCheckableValue;
 import org.w3c.css.values.CssExpression;
 import org.w3c.css.values.CssString;
 import org.w3c.css.values.CssURL;
@@ -45,6 +47,7 @@
 import org.w3c.css.values.CssUnicodeRange;
 import org.w3c.css.values.CssResolution;
 import org.w3c.css.values.CssRatio;
+import org.w3c.css.values.CssTypes;
 import org.w3c.css.properties.css.CssProperty;
 import org.w3c.css.parser.Frame;
 import org.w3c.css.parser.CssError;
@@ -352,19 +355,32 @@
     private void setValue(CssValue v, CssExpression expr, 
 			  char operator, Token n, int token) 
 	throws ParseException {
+
+	if ( token == FUNCTION ) {
+	    if ( v.getType() == CssTypes.CSS_FUNCTION ) {
+            CssFunction f = (CssFunction) v;
+      	    if (f.getParameters().hasVendorExtensions()) {
+      	        expr.markVendorExtension();
+            }
+        }
+	}
 	if (n != null) {
 	    if (ac.getCssVersion() == CssVersion.CSS1 &&
-		(n.image).equals("inherit")) {
-		incompatible_error = true;
+		                          (n.image).equals("inherit")) {
+		    incompatible_error = true;
 	    }	
 	    String val = (operator == ' ') ? n.image : operator+n.image;
 
 	    if (n.kind == CssParserConstants.IDENT) {
-		v.set(convertIdent(val), ac);
+	        String s = convertIdent(val);
+            if ('-' == s.charAt(0)) {
+                expr.markVendorExtension();
+            }
+		    v.set(convertIdent(val), ac);
 	    } else if (n.kind == CssParserConstants.STRING) {
-		v.set(val, ac); 
+		    v.set(val, ac);
 	    } else {
-		v.set(val, ac); 
+		    v.set(val, ac);
 	    }
 	}
 	expr.addValue(v);
@@ -2296,6 +2312,9 @@
 	} else {
 	    CssFunction f = new CssFunction();
 	    f.set(n.image.substring(0, n.image.length() - 1), exp);
+	    if (funcname.charAt(0) == '-') {
+	        exp.markVendorExtension();
+	    }
 	    return f;
 	}
     }

Index: CssParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- CssParser.java	6 Sep 2012 12:37:52 -0000	1.84
+++ CssParser.java	4 Oct 2012 13:16:49 -0000	1.85
@@ -7,8 +7,10 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.net.URL;
+import java.math.BigDecimal;
 
 import org.w3c.css.values.CssValue;
+import org.w3c.css.values.CssCheckableValue;
 import org.w3c.css.values.CssExpression;
 import org.w3c.css.values.CssString;
 import org.w3c.css.values.CssURL;
@@ -25,6 +27,7 @@
 import org.w3c.css.values.CssUnicodeRange;
 import org.w3c.css.values.CssResolution;
 import org.w3c.css.values.CssRatio;
+import org.w3c.css.values.CssTypes;
 import org.w3c.css.properties.css.CssProperty;
 import org.w3c.css.parser.Frame;
 import org.w3c.css.parser.CssError;
@@ -332,19 +335,32 @@
     private void setValue(CssValue v, CssExpression expr,
                           char operator, Token n, int token)
         throws ParseException {
+
+        if ( token == FUNCTION ) {
+            if ( v.getType() == CssTypes.CSS_FUNCTION ) {
+            CssFunction f = (CssFunction) v;
+            if (f.getParameters().hasVendorExtensions()) {
+                expr.markVendorExtension();
+            }
+        }
+        }
         if (n != null) {
             if (ac.getCssVersion() == CssVersion.CSS1 &&
-                (n.image).equals("inherit")) {
-                incompatible_error = true;
+                                          (n.image).equals("inherit")) {
+                    incompatible_error = true;
             }
             String val = (operator == ' ') ? n.image : operator+n.image;
 
             if (n.kind == CssParserConstants.IDENT) {
-                v.set(convertIdent(val), ac);
+                String s = convertIdent(val);
+            if ('-' == s.charAt(0)) {
+                expr.markVendorExtension();
+            }
+                    v.set(convertIdent(val), ac);
             } else if (n.kind == CssParserConstants.STRING) {
-                v.set(val, ac);
+                    v.set(val, ac);
             } else {
-                v.set(val, ac);
+                    v.set(val, ac);
             }
         }
         expr.addValue(v);
@@ -3780,7 +3796,7 @@
         if (funcname.equals("rgb(")) {
             color.setRGBColor(exp, ac);
             {if (true) return color;}
-        } else if (n.image.toLowerCase().equals("atsc-rgba(")) {
+        } else if (funcname.equals("atsc-rgba(")) {
             if (getAtRule().toString().equals("@media atsc-tv")) {
                 color.setATSCRGBAColor(exp, ac);
                 {if (true) return color;}
@@ -3791,8 +3807,10 @@
             }
         } else {
             CssFunction f = new CssFunction();
-            f.set(n.image.substring(0, n.image.length() - 1),
-                  exp);
+            f.set(n.image.substring(0, n.image.length() - 1), exp);
+            if (funcname.charAt(0) == '-') {
+                exp.markVendorExtension();
+            }
             {if (true) return f;}
         }
     throw new Error("Missing return statement in function");
@@ -4090,6 +4108,16 @@
     finally { jj_save(1, xla); }
   }
 
+  private boolean jj_3R_93() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(35)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(48)) return true;
+    }
+    return false;
+  }
+
   private boolean jj_3_2() {
     if (jj_scan_token(NUMBER)) return true;
     Token xsp;
@@ -4109,16 +4137,6 @@
     return false;
   }
 
-  private boolean jj_3R_93() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(35)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(48)) return true;
-    }
-    return false;
-  }
-
   /** Generated Token Manager. */
   public CssParserTokenManager token_source;
   SimpleCharStream jj_input_stream;
Received on Thursday, 4 October 2012 13:17:08 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:52 UTC