CVS 2002/css-validator/org/w3c/css/properties/css2

Update of /sources/public/2002/css-validator/org/w3c/css/properties/css2
In directory roscoe:/tmp/cvs-serv28421/css2

Modified Files:
	CssListStyle.java 
Log Message:
fixed the 'none' case

--- /sources/public/2002/css-validator/org/w3c/css/properties/css2/CssListStyle.java	2012/11/14 13:58:27	1.2
+++ /sources/public/2002/css-validator/org/w3c/css/properties/css2/CssListStyle.java	2013/01/09 10:50:39	1.3
@@ -1,4 +1,4 @@
-// $Id: CssListStyle.java,v 1.2 2012/11/14 13:58:27 ylafon Exp $
+// $Id: CssListStyle.java,v 1.3 2013/01/09 10:50:39 ylafon Exp $
 // Author: Yves Lafon <ylafon@w3.org>
 //
 // (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
@@ -62,6 +62,7 @@
 		CssValue imageVal = null;
 		CssValue positionVal = null;
 		CssValue typeVal = null;
+		int nbnone = 0;
 
 		while (!expression.end()) {
 			val = expression.getValue();
@@ -87,13 +88,7 @@
 						break;
 					}
 					if (none.equals(val)) {
-						if (imageVal != null || typeVal != null) {
-							// TODO duplicate value error
-							throw new InvalidParamException("value", val,
-									getPropertyName(), ac);
-						}
-						typeVal = none;
-						imageVal = none;
+						nbnone++;
 						break;
 					}
 					// now we go to other values...
@@ -121,6 +116,39 @@
 			}
 			expression.next();
 		}
+
+		// some postprocessing...
+		if (nbnone > 0) {
+			switch (nbnone) {
+				case 1:
+					// we set the value ot the non-specified by the shorthand
+					// values...
+					if (imageVal != null && typeVal != null) {
+						// TODO duplicate value error
+						throw new InvalidParamException("value", none,
+								getPropertyName(), ac);
+					}
+					if (typeVal == null) {
+						typeVal = none;
+					}
+					if (imageVal == null) {
+						imageVal = none;
+					}
+					break;
+				case 2:
+					if (imageVal != null || typeVal != null) {
+						// TODO duplicate value error
+						throw new InvalidParamException("value", none,
+								getPropertyName(), ac);
+					}
+					typeVal = none;
+					imageVal = none;
+					break;
+				default:
+					throw new InvalidParamException("value", none,
+							getPropertyName(), ac);
+			}
+		}
 		// set the value
 		if (value != inherit) {
 			ArrayList<CssValue> v = new ArrayList<CssValue>();

Received on Wednesday, 9 January 2013 10:50:40 UTC