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

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

From: CVS User ylafon <cvsmail@w3.org>
Date: Tue, 11 Dec 2012 15:22:37 +0000
Message-Id: <E1TiRfJ-0000bi-Jb@roscoe.w3.org>
To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory roscoe:/tmp/cvs-serv2328

Modified Files:
	CssFontSizeAdjust.java 
Log Message:
updated to latest spec

--- /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssFontSizeAdjust.java	2012/08/04 21:17:06	1.1
+++ /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssFontSizeAdjust.java	2012/12/11 15:22:37	1.2
@@ -1,4 +1,4 @@
-// $Id: CssFontSizeAdjust.java,v 1.1 2012/08/04 21:17:06 ylafon Exp $
+// $Id: CssFontSizeAdjust.java,v 1.2 2012/12/11 15:22:37 ylafon Exp $
 // Author: Yves Lafon <ylafon@w3.org>
 //
 // (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
@@ -13,10 +13,30 @@
 import org.w3c.css.values.CssValue;
 
 /**
- * @spec http://www.w3.org/TR/2011/WD-css3-fonts-20111004/#font-size-adjust-prop
+ * @spec http://www.w3.org/TR/2012/WD-css3-fonts-20121211/#propdef-font-size-adjust
  */
 public class CssFontSizeAdjust extends org.w3c.css.properties.css.CssFontSizeAdjust {
 
+	public static final CssIdent[] allowed_values;
+
+	static {
+		String[] _allowed_values = {"none", "auto"};
+		int i = 0;
+		allowed_values = new CssIdent[_allowed_values.length];
+		for (String s : _allowed_values) {
+			allowed_values[i++] = CssIdent.getIdent(s);
+		}
+	}
+
+	public static final CssIdent getAllowedIdent(CssIdent ident) {
+		for (CssIdent id : allowed_values) {
+			if (id.equals(ident)) {
+				return id;
+			}
+		}
+		return null;
+	}
+
 	/**
 	 * Create a new CssFontSizeAdjust
 	 */
@@ -50,12 +70,13 @@
 				CssIdent id = (CssIdent) val;
 				if (inherit.equals(id)) {
 					value = inherit;
-				} else if (none.equals(id)) {
-					value = none;
 				} else {
-					throw new InvalidParamException("value",
-							val.toString(),
-							getPropertyName(), ac);
+					value = getAllowedIdent(id);
+					if (value == null) {
+						throw new InvalidParamException("value",
+								val.toString(),
+								getPropertyName(), ac);
+					}
 				}
 				break;
 			case CssTypes.CSS_NUMBER:
Received on Tuesday, 11 December 2012 15:22:50 UTC

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