2002/css-validator/org/w3c/css/properties/css3 CssFontVariantLigatures.java,1.4,1.5

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

Modified Files:
	CssFontVariantLigatures.java 
Log Message:
updated to latest spec http://www.w3.org/TR/2012/WD-css3-fonts-20120823/#propdef-font-variant-numeric

Index: CssFontVariantLigatures.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssFontVariantLigatures.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssFontVariantLigatures.java	25 Aug 2012 12:41:39 -0000	1.4
+++ CssFontVariantLigatures.java	27 Aug 2012 10:44:19 -0000	1.5
@@ -17,47 +17,66 @@
 import java.util.ArrayList;
 
 /**
- * @spec http://www.w3.org/TR/2011/WD-css3-fonts-20111004/#propdef-font-variant-ligatures
+ * @spec http://www.w3.org/TR/2012/WD-css3-fonts-20120823/#propdef-font-variant-ligatures
  */
 public class CssFontVariantLigatures extends org.w3c.css.properties.css.CssFontVariantLigatures {
 
-	public static final String[] commonLigValues = {"common-ligatures", "no-common-ligatures"};
-	public static final String[] discretionaryLigValues = {"discretionary-ligatures",
-			"no-discretionary-ligatures"};
-	public static final String[] historicalLigValues = {"historical-ligatures",
-			"no-historical-ligatures"};
+	public static final CssIdent[] commonLigValues;
+	public static final CssIdent[] discretionaryLigValues;
+	public static final CssIdent[] historicalLigValues;
 
 	public static final CssIdent normal;
 
 	static {
+		String[] _commonLigValues = {"common-ligatures", "no-common-ligatures"};
+		String[] _discretionaryLigValues = {"discretionary-ligatures",
+				"no-discretionary-ligatures"};
+		String[] _historicalLigValues = {"historical-ligatures",
+				"no-historical-ligatures"};
+
 		normal = CssIdent.getIdent("normal");
+
+		commonLigValues = new CssIdent[_commonLigValues.length];
+		int i = 0;
+		for (String s : _commonLigValues) {
+			commonLigValues[i++] = CssIdent.getIdent(s);
+		}
+
+		discretionaryLigValues = new CssIdent[_discretionaryLigValues.length];
+		i = 0;
+		for (String s : _discretionaryLigValues) {
+			discretionaryLigValues[i++] = CssIdent.getIdent(s);
+		}
+
+		historicalLigValues = new CssIdent[_historicalLigValues.length];
+		i = 0;
+		for (String s : _historicalLigValues) {
+			historicalLigValues[i++] = CssIdent.getIdent(s);
+		}
 	}
 
 	public static final CssIdent getCommonLigValues(CssIdent ident) {
-		String s_id = ident.toString().toLowerCase();
-		for (String s : commonLigValues) {
-			if (s_id.equals(s)) {
-				return ident;
+		for (CssIdent id : commonLigValues) {
+			if (id.equals(ident)) {
+				return id;
 			}
 		}
 		return null;
 	}
 
 	public static final CssIdent getDiscretionaryLigValues(CssIdent ident) {
-		String s_id = ident.toString().toLowerCase();
-		for (String s : discretionaryLigValues) {
-			if (s_id.equals(s)) {
-				return ident;
+		for (CssIdent id : discretionaryLigValues) {
+			if (id.equals(ident)) {
+				return id;
 			}
 		}
 		return null;
 	}
 
 	public static final CssIdent getHistoricalLigValues(CssIdent ident) {
-		String s_id = ident.toString().toLowerCase();
-		for (String s : historicalLigValues) {
-			if (s_id.equals(s)) {
-				return ident;
+		for (CssIdent id : historicalLigValues) {
+			if (id.equals(ident)) {
+				return id;
 			}
 		}
 		return null;
@@ -65,6 +84,9 @@
 
 	public static final CssIdent getAllowedValue(CssIdent ident) {
 		CssIdent id;
+		if (none.equals(ident)) {
+			return none;
+		}
 		id = getCommonLigValues(ident);
 		if (id == null) {
 			id = getDiscretionaryLigValues(ident);
@@ -125,6 +147,13 @@
 								getPropertyName(), ac);
 					}
 					value = normal;
+				} else if (none.equals(ident)) {
+					if (expression.getCount() != 1) {
+						throw new InvalidParamException("value",
+								val.toString(),
+								getPropertyName(), ac);
+					}
+					value = none;
 				} else {
 					// no inherit, nor normal, test the up-to-three values
 					match = false;

Received on Monday, 27 August 2012 10:44:23 UTC