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

2002/css-validator/org/w3c/css/properties/css3 CssFontVariantPosition.java,NONE,1.1 Css3Style.java,1.24,1.25

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 08 Aug 2012 10:02:10 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1Sz35e-0007Fd-Kg@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv27751/w3c/css/properties/css3

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

--- NEW FILE: CssFontVariantPosition.java ---
// $Id: CssFontVariantPosition.java,v 1.1 2012/08/08 10:02:08 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.CssTypes;
import org.w3c.css.values.CssValue;

import java.util.HashMap;

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

	public static final String[] _allowedValues = {"normal", "sub",
			"super", "ordinal"};

	public static final HashMap<String, CssIdent> allowedValues;

	static {
		allowedValues = new HashMap<String, CssIdent>(_allowedValues.length);
		for (String s : _allowedValues) {
			allowedValues.put(s, CssIdent.getIdent(s));
		}
	}

	/**
	 * Create a new CssFontVariantPosition
	 */
	public CssFontVariantPosition() {
		value = initial;
	}

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

		CssValue val;
		char op;

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

		if (val.getType() == CssTypes.CSS_IDENT) {
			CssIdent ident = (CssIdent) val;
			if (inherit.equals(ident)) {
				value = inherit;
			} else {
				value = allowedValues.get(ident.toString());
				if (value == null) {
					throw new InvalidParamException("value",
							val.toString(),
							getPropertyName(), ac);
				}
			}
		} else {
			throw new InvalidParamException("value",
					val.toString(),
					getPropertyName(), ac);
		}
		expression.next();
	}

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


Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- Css3Style.java	7 Aug 2012 12:09:17 -0000	1.24
+++ Css3Style.java	8 Aug 2012 10:02:08 -0000	1.25
@@ -31,6 +31,7 @@
 import org.w3c.css.properties.css.CssFontKerning;
 import org.w3c.css.properties.css.CssFontLanguageOverride;
 import org.w3c.css.properties.css.CssFontVariantCaps;
+import org.w3c.css.properties.css.CssFontVariantPosition;
 import org.w3c.css.properties.css.CssOpacity;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.Util;
@@ -145,6 +146,7 @@
 	public CssFontKerning cssFontKerning;
 	public CssFontLanguageOverride cssFontLanguageOverride;
 	public CssFontVariantCaps cssFontVariantCaps;
+	public CssFontVariantPosition cssFontVariantPosition;
 
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
@@ -1583,6 +1585,15 @@
 		return cssFontVariantCaps;
 	}
 
+	public CssFontVariantPosition getFontVariantPosition() {
+		if (cssFontVariantCaps == null) {
+			cssFontVariantCaps =
+					(CssFontVariantCaps) style.CascadingOrder(
+							new CssFontVariantCaps(), style, selector);
+		}
+		return cssFontVariantPosition;
+	}
+
 	public CssTextIndentCSS3 getTextIndentCSS3() {
 		if (cssTextIndentCSS3 == null) {
 			cssTextIndentCSS3 =
Received on Wednesday, 8 August 2012 10:02:13 UTC

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