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

2002/css-validator/org/w3c/css/properties/css3 CssFontVariantAlternates.java,1.2,1.3 CssFontVariantEastAsian.java,1.3,1.4 CssFontVariantLigatures.java,1.3,1.4 CssFontVariantNumeric.java,1.2,1.3

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Sat, 25 Aug 2012 12:41:41 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1T5FgL-00075r-PD@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv27253/css3

Modified Files:
	CssFontVariantAlternates.java CssFontVariantEastAsian.java 
	CssFontVariantLigatures.java CssFontVariantNumeric.java 
Log Message:
accessors to test property-specific idents (ie: all minus 'normal')

Index: CssFontVariantAlternates.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssFontVariantAlternates.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssFontVariantAlternates.java	19 Aug 2012 17:28:25 -0000	1.2
+++ CssFontVariantAlternates.java	25 Aug 2012 12:41:39 -0000	1.3
@@ -22,7 +22,7 @@
  */
 public class CssFontVariantAlternates extends org.w3c.css.properties.css.CssFontVariantAlternates {
 
-	public static final String[] contextualAltValues = {"contextual", "no-contextual"};
+	public static final CssIdent[] contextualAltValues;
 
 	public static final CssIdent normal;
 	public static final CssIdent ruby;
@@ -32,13 +32,33 @@
 		normal = CssIdent.getIdent("normal");
 		ruby = CssIdent.getIdent("ruby");
 		historicalForms = CssIdent.getIdent("historical-forms");
+		String[] _contextualAltValues = {"contextual", "no-contextual"};
+		contextualAltValues = new CssIdent[_contextualAltValues.length];
+		int i = 0;
+		for (String s : _contextualAltValues) {
+			contextualAltValues[i++] = CssIdent.getIdent(s);
+		}
 	}
 
 	public static final CssIdent getContextualAltValues(CssIdent ident) {
-		String s_id = ident.toString().toLowerCase();
-		for (String s : contextualAltValues) {
-			if (s_id.equals(s)) {
-				return ident;
+		for (CssIdent id : contextualAltValues) {
+			if (id.equals(ident)) {
+				return id;
+			}
+		}
+		return null;
+	}
+
+	public static final CssIdent getAllowedIdent(CssIdent ident) {
+		if (ruby.equals(ident)) {
+			return ruby;
+		}
+		if (historicalForms.equals(ident)) {
+			return historicalForms;
+		}
+		for (CssIdent id : contextualAltValues) {
+			if (id.equals(ident)) {
+				return id;
 			}
 		}
 		return null;

Index: CssFontVariantEastAsian.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssFontVariantEastAsian.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssFontVariantEastAsian.java	23 Aug 2012 13:55:34 -0000	1.3
+++ CssFontVariantEastAsian.java	25 Aug 2012 12:41:39 -0000	1.4
@@ -63,7 +63,7 @@
 		return null;
 	}
 
-	public static final CssIdent getEastAsianValue(CssIdent ident) {
+	public static final CssIdent getAllowedValue(CssIdent ident) {
 		CssIdent id = getEastAsianWidthValue(ident);
 		if (id == null) {
 			id = getEastAsianVariantValue(ident);

Index: CssFontVariantLigatures.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssFontVariantLigatures.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssFontVariantLigatures.java	19 Aug 2012 17:28:25 -0000	1.3
+++ CssFontVariantLigatures.java	25 Aug 2012 12:41:39 -0000	1.4
@@ -63,6 +63,18 @@
 		return null;
 	}
 
+	public static final CssIdent getAllowedValue(CssIdent ident) {
+		CssIdent id;
+		id = getCommonLigValues(ident);
+		if (id == null) {
+			id = getDiscretionaryLigValues(ident);
+			if (id == null) {
+				id = getHistoricalLigValues(ident);
+			}
+		}
+		return id;
+	}
+
 	/**
 	 * Create a new CssFontVariantLigatures
 	 */

Index: CssFontVariantNumeric.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssFontVariantNumeric.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssFontVariantNumeric.java	19 Aug 2012 17:28:25 -0000	1.2
+++ CssFontVariantNumeric.java	25 Aug 2012 12:41:39 -0000	1.3
@@ -21,47 +21,77 @@
  */
 public class CssFontVariantNumeric extends org.w3c.css.properties.css.CssFontVariantNumeric {
 
-	public static final String[] numericFigValues = {"lining-nums", "oldstyle-nums"};
-	public static final String[] numericSpaValues = {"proportional-nums", "tabular-nums"};
-	public static final String[] numericFraValues = {"diagonal-fractions", "stacked-fractions"};
-
 	public static final CssIdent normal, slashedZero;
+	public static final CssIdent[] numericFigValues;
+	public static final CssIdent[] numericSpaValues;
+	public static final CssIdent[] numericFraValues;
 
 	static {
+		String[] _numericFigValues = {"lining-nums", "oldstyle-nums"};
+		String[] _numericSpaValues = {"proportional-nums", "tabular-nums"};
+		String[] _numericFraValues = {"diagonal-fractions", "stacked-fractions"};
+
 		normal = CssIdent.getIdent("normal");
 		slashedZero = CssIdent.getIdent("slashed-zero");
+		numericFigValues = new CssIdent[_numericFigValues.length];
+		int i = 0;
+		for (String s : _numericFigValues) {
+			numericFigValues[i++] = CssIdent.getIdent(s);
+		}
+		numericSpaValues = new CssIdent[_numericSpaValues.length];
+		i = 0;
+		for (String s : _numericSpaValues) {
+			numericSpaValues[i++] = CssIdent.getIdent(s);
+		}
+		numericFraValues = new CssIdent[_numericFraValues.length];
+		i = 0;
+		for (String s : _numericFraValues) {
+			numericFraValues[i++] = CssIdent.getIdent(s);
+		}
 	}
 
 	public static final CssIdent getNumericFigValues(CssIdent ident) {
-		String s_id = ident.toString().toLowerCase();
-		for (String s : numericFigValues) {
-			if (s_id.equals(s)) {
-				return ident;
+		for (CssIdent id : numericFigValues) {
+			if (id.equals(ident)) {
+				return id;
 			}
 		}
 		return null;
 	}
 
 	public static final CssIdent getNumericSpaValues(CssIdent ident) {
-		String s_id = ident.toString().toLowerCase();
-		for (String s : numericSpaValues) {
-			if (s_id.equals(s)) {
-				return ident;
+		for (CssIdent id : numericSpaValues) {
+			if (id.equals(ident)) {
+				return id;
 			}
 		}
 		return null;
 	}
 
 	public static final CssIdent getNumericFraValues(CssIdent ident) {
-		String s_id = ident.toString().toLowerCase();
-		for (String s : numericFraValues) {
-			if (s_id.equals(s)) {
-				return ident;
+		for (CssIdent id : numericFraValues) {
+			if (id.equals(ident)) {
+				return id;
 			}
 		}
 		return null;
 	}
 
+	public static final CssIdent getAllowedValue(CssIdent ident) {
+		CssIdent id;
+		if (slashedZero.equals(ident)) {
+			return slashedZero;
+		}
+		id = getNumericFigValues(ident);
+		if (id == null) {
+			id = getNumericFraValues(ident);
+			if (id == null) {
+				id = getNumericSpaValues(ident);
+			}
+		}
+		return id;
+	}
+
 	/**
 	 * Create a new CssFontVariantNumeric
 	 */
Received on Saturday, 25 August 2012 12:41:42 UTC

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