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

2002/css-validator/org/w3c/css/properties/css3 CssFontVariantEastAsian.java,NONE,1.1 Css3Style.java,1.26,1.27

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 09 Aug 2012 08:47:47 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1SzOPD-00014R-M6@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv3958/w3c/css/properties/css3

Modified Files:
	Css3Style.java 
Added Files:
	CssFontVariantEastAsian.java 
Log Message:
font-variant-east-asian per http://www.w3.org/TR/2011/WD-css3-fonts-20111004/#propdef-font-variant-east-asian

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- Css3Style.java	8 Aug 2012 21:05:40 -0000	1.26
+++ Css3Style.java	9 Aug 2012 08:47:45 -0000	1.27
@@ -32,6 +32,7 @@
 import org.w3c.css.properties.css.CssFontLanguageOverride;
 import org.w3c.css.properties.css.CssFontSynthesis;
 import org.w3c.css.properties.css.CssFontVariantCaps;
+import org.w3c.css.properties.css.CssFontVariantEastAsian;
 import org.w3c.css.properties.css.CssFontVariantPosition;
 import org.w3c.css.properties.css.CssOpacity;
 import org.w3c.css.util.ApplContext;
@@ -149,6 +150,7 @@
 	public CssFontVariantCaps cssFontVariantCaps;
 	public CssFontVariantPosition cssFontVariantPosition;
 	public CssFontSynthesis cssFontSynthesis;
+	public CssFontVariantEastAsian cssFontVariantEastAsian;
 
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
@@ -1605,6 +1607,17 @@
 		return cssFontSynthesis;
 	}
 
+	public CssFontVariantEastAsian getFontVariantEastAsian() {
+		if (cssFontVariantEastAsian == null) {
+			cssFontVariantEastAsian =
+					(CssFontVariantEastAsian) style.CascadingOrder(
+							new CssFontVariantEastAsian(), style, selector);
+		}
+		return cssFontVariantEastAsian;
+	}
+
+	///
+
 	public CssTextIndentCSS3 getTextIndentCSS3() {
 		if (cssTextIndentCSS3 == null) {
 			cssTextIndentCSS3 =

--- NEW FILE: CssFontVariantEastAsian.java ---
// $Id: CssFontVariantEastAsian.java,v 1.1 2012/08/09 08:47:45 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * @spec http://www.w3.org/TR/2011/WD-css3-fonts-20111004/#propdef-font-variant-east-asian
 */
public class CssFontVariantEastAsian extends org.w3c.css.properties.css.CssFontVariantEastAsian {

	public static final String[] _eastAsianVariantValues = { "jis78", "jis83", "jis90", "jis04",
			"simplified", "traditional"};
	public static final String[] _eastAsianWidthValues = { "full-width", "proportional-width"};

	public static final HashMap<String,CssIdent> eastAsianVariantValues;
	public static final HashMap<String,CssIdent> eastAsianWidthValues;

	public static final CssIdent normal;

	static {
		normal = CssIdent.getIdent("normal");

		eastAsianVariantValues = new HashMap<String, CssIdent>(_eastAsianVariantValues.length);
		for (String s: _eastAsianVariantValues) {
			eastAsianVariantValues.put(s, CssIdent.getIdent(s));
		}
		eastAsianWidthValues = new HashMap<String, CssIdent>(_eastAsianWidthValues.length);
		for (String s: _eastAsianWidthValues) {
			eastAsianWidthValues.put(s, CssIdent.getIdent(s));
		}
	}
    /**
     * Create a new CssFontVariantEastAsian
     */
    public CssFontVariantEastAsian() {
		value = initial;
    }

    /**
     * Creates a new CssFontVariantEastAsian
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssFontVariantEastAsian(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
		if (check && expression.getCount() > 2) {
			throw new InvalidParamException("unrecognize", ac);
		}

		setByUser();

		CssValue val;
		char op;

		val = expression.getValue();
		op = expression.getOperator();

		value = null;

		if (val.getType() == CssTypes.CSS_IDENT) {
			CssIdent ident = (CssIdent) val;
			if (inherit.equals(ident)) {
				value = inherit;
			} else if (normal.equals(ident)) {
				value = normal;
			} else {
				value = eastAsianVariantValues.get(ident.toString());
				if (value != null) {
					if (expression.getCount() > 1) {
						if (op != CssOperator.SPACE) {
							throw new InvalidParamException("operator",
									((new Character(op)).toString()), ac);
						}
						expression.next();
						val = expression.getValue();
						CssIdent value2 = null;
						if (val.getType() == CssTypes.CSS_IDENT) {
							value2 = eastAsianWidthValues.get(val.toString());
						}
						if (value2 == null) {
							throw new InvalidParamException("value",
									val.toString(),
									getPropertyName(), ac);
						}
						ArrayList<CssValue> v = new ArrayList<CssValue>(2);
						v.add(value);
						v.add(value2);
						value = new CssValueList(v);
					}
				} else {
					value = eastAsianWidthValues.get(ident.toString());
					if (value != null) {
						if (expression.getCount() > 1) {
							if (op != CssOperator.SPACE) {
								throw new InvalidParamException("operator",
										((new Character(op)).toString()), ac);
							}
							expression.next();
							val = expression.getValue();
							CssIdent value2 = null;
							if (val.getType() == CssTypes.CSS_IDENT) {
								value2 = eastAsianVariantValues.get(val.toString());
							}
							if (value2 == null) {
								throw new InvalidParamException("value",
										val.toString(),
										getPropertyName(), ac);
							}
							ArrayList<CssValue> v = new ArrayList<CssValue>(2);
							v.add(value2);
							v.add(value);
							value = new CssValueList(v);
						}
					} else {
						throw new InvalidParamException("value",
								val.toString(),
								getPropertyName(), ac);
					}
				}
			}
		} else {
			throw new InvalidParamException("value",
					val.toString(),
					getPropertyName(), ac);
		}
		expression.next();
    }

    public CssFontVariantEastAsian(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

}
Received on Thursday, 9 August 2012 08:47:55 UTC

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