2002/css-validator/org/w3c/css/properties/css3 CssTransformOrigin.java,1.2,1.3

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

Modified Files:
	CssTransformOrigin.java 
Log Message:
vertical and horizontal can be in any order

Index: CssTransformOrigin.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssTransformOrigin.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssTransformOrigin.java	19 Oct 2012 13:49:19 -0000	1.2
+++ CssTransformOrigin.java	19 Oct 2012 14:07:50 -0000	1.3
@@ -50,11 +50,11 @@
 	}
 
 	public boolean isVerticalIdent(CssIdent ident) {
-		return top.equals(ident) || center.equals(ident) || bottom.equals(ident);
+		return top.equals(ident) || bottom.equals(ident);
 	}
 
 	public boolean isHorizontalIdent(CssIdent ident) {
-		return left.equals(ident) || center.equals(ident) || right.equals(ident);
+		return left.equals(ident) || right.equals(ident);
 	}
 
 	/**
@@ -143,18 +143,26 @@
 		// then we need to ckeck the values if we got two values and
 		// at least one keyword (as restrictions may occur)
 		if (nb_keyword > 0 && nb_values >= 2) {
+			boolean gothorizontal = false;
+			boolean gotvertical = false;
 			CssValue v = values.get(0);
 			if (v.getType() == CssTypes.CSS_IDENT) {
 				CssIdent id = (CssIdent) v;
-				if (!isHorizontalIdent(id)) {
-					throw new InvalidParamException("value", id,
-							getPropertyName(), ac);
+				// strictly horizontal or vertical
+				gothorizontal = isHorizontalIdent(id);
+				if (!gothorizontal) {
+					gotvertical = isVerticalIdent(id);
 				}
 			}
 			v = values.get(1);
 			if (v.getType() == CssTypes.CSS_IDENT) {
 				CssIdent id = (CssIdent) v;
-				if (!isVerticalIdent(id)) {
+				// yeah, it can be a single ugly test.
+				if (gothorizontal && isHorizontalIdent(id)) {
+					throw new InvalidParamException("value", id,
+							getPropertyName(), ac);
+				}
+				if (gotvertical && isVerticalIdent(id)) {
 					throw new InvalidParamException("value", id,
 							getPropertyName(), ac);
 				}
@@ -165,7 +173,7 @@
 		if (nb_values == 3) {
 			CssValue v = values.get(2);
 			if (v.getType() != CssTypes.CSS_LENGTH &&
-				v.getType() != CssTypes.CSS_NUMBER) {
+					v.getType() != CssTypes.CSS_NUMBER) {
 				throw new InvalidParamException("value", v,
 						getPropertyName(), ac);
 			}

Received on Friday, 19 October 2012 14:07:53 UTC