2002/css-validator/org/w3c/css/properties/css3 CssFontVariantNumeric.java,1.3,1.4

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

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

Index: CssFontVariantNumeric.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssFontVariantNumeric.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssFontVariantNumeric.java	25 Aug 2012 12:41:39 -0000	1.3
+++ CssFontVariantNumeric.java	27 Aug 2012 10:01:48 -0000	1.4
@@ -17,11 +17,11 @@
 import java.util.ArrayList;
 
 /**
- * @spec http://www.w3.org/TR/2011/WD-css3-fonts-20111004/#propdef-font-variant-numeric
+ * @spec http://www.w3.org/TR/2012/WD-css3-fonts-20120823/#propdef-font-variant-numeric
  */
 public class CssFontVariantNumeric extends org.w3c.css.properties.css.CssFontVariantNumeric {
 
-	public static final CssIdent normal, slashedZero;
+	public static final CssIdent normal, slashedZero, ordinal;
 	public static final CssIdent[] numericFigValues;
 	public static final CssIdent[] numericSpaValues;
 	public static final CssIdent[] numericFraValues;
@@ -33,6 +33,7 @@
 
 		normal = CssIdent.getIdent("normal");
 		slashedZero = CssIdent.getIdent("slashed-zero");
+		ordinal = CssIdent.getIdent("ordinal");
 		numericFigValues = new CssIdent[_numericFigValues.length];
 		int i = 0;
 		for (String s : _numericFigValues) {
@@ -82,6 +83,9 @@
 		if (slashedZero.equals(ident)) {
 			return slashedZero;
 		}
+		if (ordinal.equals(ident)) {
+			return ordinal;
+		}
 		id = getNumericFigValues(ident);
 		if (id == null) {
 			id = getNumericFraValues(ident);
@@ -108,7 +112,7 @@
 	 */
 	public CssFontVariantNumeric(ApplContext ac, CssExpression expression, boolean check)
 			throws InvalidParamException {
-		if (check && expression.getCount() > 4) {
+		if (check && expression.getCount() > 5) {
 			throw new InvalidParamException("unrecognize", ac);
 		}
 
@@ -121,6 +125,7 @@
 		CssIdent figValue = null;
 		CssIdent spaValue = null;
 		CssIdent zerValue = null;
+		CssIdent ordValue = null;
 		boolean match;
 
 		while (!expression.end()) {
@@ -164,6 +169,12 @@
 							zerValue = slashedZero;
 						}
 					}
+					if (!match && ordValue == null) {
+						match = ordinal.equals(ident);
+						if (match) {
+							ordValue = ordinal;
+						}
+					}
 					if (!match) {
 						throw new InvalidParamException("value",
 								val.toString(),
@@ -193,6 +204,8 @@
 				value = spaValue;
 			} else if (zerValue != null) {
 				value = zerValue;
+			} else if (ordValue != null) {
+				value = ordValue;
 			}
 		} else {
 			// do this to keep the same order for comparisons
@@ -209,6 +222,9 @@
 			if (zerValue != null) {
 				v.add(zerValue);
 			}
+			if (ordValue != null) {
+				v.add(ordValue);
+			}
 			value = new CssValueList(v);
 		}
 

Received on Monday, 27 August 2012 10:01:52 UTC