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

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

Modified Files:
	CssAzimuth.java 
Log Message:
number 0 can't be an angle, error for non-deg angle unit is bogus

Index: CssAzimuth.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssAzimuth.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssAzimuth.java	10 Sep 2011 14:20:13 -0000	1.2
+++ CssAzimuth.java	10 Sep 2011 20:24:47 -0000	1.3
@@ -11,7 +11,6 @@
 import org.w3c.css.values.CssAngle;
 import org.w3c.css.values.CssExpression;
 import org.w3c.css.values.CssIdent;
-import org.w3c.css.values.CssNumber;
 import org.w3c.css.values.CssOperator;
 import org.w3c.css.values.CssTypes;
 import org.w3c.css.values.CssValue;
@@ -93,17 +92,16 @@
         setByUser();
 
         switch (val.getType()) {
-            case CssTypes.CSS_NUMBER:
-                // if the number is a valid number, let it flow
-                val = ((CssNumber) val).getAngle();
             case CssTypes.CSS_ANGLE:
                 if (check && expression.getCount() > 1) {
                     throw new InvalidParamException("unrecognize", ac);
                 }
                 angleValue = (CssAngle) val;
-                if (!angleValue.isDegree()) {
-                    throw new InvalidParamException("degree", null, ac);
-                }
+                // FIXME is the following really true? not per spec...
+//                if (!angleValue.isDegree()) {
+//                    throw new InvalidParamException("degree", ac);
+//                }
+                // TODO check unit according to css level
                 expression.next();
                 break;
             case CssTypes.CSS_IDENT:
@@ -135,7 +133,7 @@
                 if (expression.getCount() > 1) {
                     val = expression.getValue();
                     if (val.getType() != CssTypes.CSS_IDENT) {
-                        throw new InvalidParamException("unrecognize", ac);
+                        throw new InvalidParamException("value", val, ac);
                     }
                     ident = (CssIdent) val;
 
@@ -164,7 +162,7 @@
                 }
                 break;
             default:
-                throw new InvalidParamException("value", ac);
+                throw new InvalidParamException("value", val, ac);
         }
     }
 

Received on Saturday, 10 September 2011 20:24:51 UTC