- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 27 Aug 2012 14:55:35 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3 In directory hutz:/tmp/cvs-serv19509 Modified Files: CssFontVariantLigatures.java Log Message: updated to http://www.w3.org/TR/2012/WD-css3-fonts-20120823/#propdef-font-variant-ligatures Index: CssFontVariantLigatures.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssFontVariantLigatures.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- CssFontVariantLigatures.java 27 Aug 2012 10:44:19 -0000 1.5 +++ CssFontVariantLigatures.java 27 Aug 2012 14:55:33 -0000 1.6 @@ -24,6 +24,7 @@ public static final CssIdent[] commonLigValues; public static final CssIdent[] discretionaryLigValues; public static final CssIdent[] historicalLigValues; + public static final CssIdent[] contextualAltValues; public static final CssIdent normal; @@ -33,6 +34,7 @@ "no-discretionary-ligatures"}; String[] _historicalLigValues = {"historical-ligatures", "no-historical-ligatures"}; + String[] _contextualAltValues = {"contextual", "no-contextual"}; normal = CssIdent.getIdent("normal"); @@ -53,6 +55,12 @@ for (String s : _historicalLigValues) { historicalLigValues[i++] = CssIdent.getIdent(s); } + + contextualAltValues = new CssIdent[_contextualAltValues.length]; + i = 0; + for (String s : _contextualAltValues) { + contextualAltValues[i++] = CssIdent.getIdent(s); + } } public static final CssIdent getCommonLigValues(CssIdent ident) { @@ -82,6 +90,15 @@ return null; } + public static final CssIdent getContextualAltValues(CssIdent ident) { + for (CssIdent id : contextualAltValues) { + if (id.equals(ident)) { + return id; + } + } + return null; + } + public static final CssIdent getAllowedValue(CssIdent ident) { CssIdent id; if (none.equals(ident)) { @@ -92,6 +109,9 @@ id = getDiscretionaryLigValues(ident); if (id == null) { id = getHistoricalLigValues(ident); + if (id == null) { + id = getContextualAltValues(ident); + } } } return id; @@ -125,6 +145,7 @@ CssIdent histValue = null; CssIdent commonValue = null; CssIdent discValue = null; + CssIdent altValue = null; boolean match; while (!expression.end()) { @@ -169,6 +190,10 @@ discValue = getDiscretionaryLigValues(ident); match = (discValue != null); } + if (!match && altValue == null) { + altValue = getContextualAltValues(ident); + match = (altValue != null); + } if (!match) { throw new InvalidParamException("value", val.toString(), @@ -196,6 +221,8 @@ value = histValue; } else if (discValue != null) { value = discValue; + } else if (altValue != null) { + value = altValue; } } else { // do this to keep the same order for comparisons @@ -209,6 +236,9 @@ if (discValue != null) { v.add(discValue); } + if (altValue != null) { + v.add(altValue); + } value = new CssValueList(v); } }
Received on Monday, 27 August 2012 14:55:43 UTC