2002/css-validator/org/w3c/css/properties/css21 CssColorCSS21.java,1.2,1.3

Update of /sources/public/2002/css-validator/org/w3c/css/properties/css21
In directory hutz:/tmp/cvs-serv8941

Modified Files:
	CssColorCSS21.java 
Log Message:
using getType()


Index: CssColorCSS21.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssColorCSS21.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssColorCSS21.java	14 Sep 2005 15:14:58 -0000	1.2
+++ CssColorCSS21.java	5 Mar 2009 18:01:18 -0000	1.3
@@ -10,6 +10,7 @@
 import org.w3c.css.values.CssExpression;
 import org.w3c.css.values.CssIdent;
 import org.w3c.css.values.CssValue;
+import org.w3c.css.values.CssTypes;
 
 /**
  * CssColorCSS21<br />
@@ -22,29 +23,35 @@
      * @param expression The expression for this property
      * @exception InvalidParamException Values are incorrect
      */
-    public CssColorCSS21(ApplContext ac, CssExpression expression, boolean check)
-	throws InvalidParamException {
-
+    public CssColorCSS21(ApplContext ac, CssExpression expression, 
+			 boolean check)
+	throws InvalidParamException 
+    {
 	if(check && expression.getCount() > 1) {
 	    throw new InvalidParamException("unrecognize", ac);
 	}
 
 	CssValue val = expression.getValue();
 	setByUser();
-	if (val.equals(inherit)) {
-	    setColor(inherit);
-	    expression.next();
-	} else if (val instanceof org.w3c.css.values.CssColor) {
+
+	switch (val.getType()) {
+	case CssTypes.CSS_COLOR:
 	    setColor(val);
-	    expression.next();
-	} else if (val instanceof CssIdent) {
+	    break;
+	case CssTypes.CSS_IDENT:
+	    if (inherit.equals(val)) {
+		setColor(inherit);
+		break;
+	    }
 	    setColor(new org.w3c.css.values.CssColorCSS21(ac,
-							(String) val.get()));
-	    expression.next();
-	} else {
+							  (String) val.get()));
+	    break;
+	default:
+	    org.w3c.util.Trace.showTrace("foo: "+val.getType()+" - "+val);
 	    throw new InvalidParamException("value", expression.getValue(),
 					    getPropertyName(), ac);
 	}
+	expression.next();
     }
 
     public CssColorCSS21(ApplContext ac, CssExpression expression)

Received on Thursday, 5 March 2009 18:01:32 UTC