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

2002/css-validator/org/w3c/css/properties/css3 CssImeMode.java,NONE,1.1 Css3Style.java,1.131,1.132

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 17 Oct 2012 08:16:26 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1TOOni-0000Hp-O0@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv1029/css3

Modified Files:
	Css3Style.java 
Added Files:
	CssImeMode.java 
Log Message:
ime-mode per http://www.w3.org/TR/2012/WD-css3-ui-20120117/#ime-mode

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- Css3Style.java	16 Oct 2012 20:44:00 -0000	1.131
+++ Css3Style.java	17 Oct 2012 08:16:24 -0000	1.132
@@ -62,6 +62,7 @@
 import org.w3c.css.properties.css.CssFontVariantPosition;
 import org.w3c.css.properties.css.CssHangingPunctuation;
 import org.w3c.css.properties.css.CssHyphens;
+import org.w3c.css.properties.css.CssImeMode;
 import org.w3c.css.properties.css.CssJustifyContent;
 import org.w3c.css.properties.css.CssLineBreak;
 import org.w3c.css.properties.css.CssMarqueeDirection;
@@ -209,6 +210,7 @@
 	public CssBoxSizing cssBoxSizing;
 	public CssResize cssResize;
 	public CssOutlineOffset cssOutlineOffset;
+	public CssImeMode cssImeMode;
 
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
@@ -1389,6 +1391,15 @@
 		return cssTransform;
 	}
 
+	public CssImeMode getImeMode() {
+		if (cssImeMode == null) {
+			cssImeMode =
+					(CssImeMode) style.CascadingOrder(
+							new CssImeMode(), style, selector);
+		}
+		return cssImeMode;
+	}
+
 	///
 
 	/**

--- NEW FILE: CssImeMode.java ---
// $Id: CssImeMode.java,v 1.1 2012/10/17 08:16:24 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;

/**
 * @spec http://www.w3.org/TR/2012/WD-css3-ui-20120117/#ime-mode
 */
public class CssImeMode extends org.w3c.css.properties.css.CssImeMode {

	public static final CssIdent[] allowed_values;

	static {
		String[] _allowed_values = {"auto", "normal", "active", "inactive", "disabled"};
		allowed_values = new CssIdent[_allowed_values.length];
		int i = 0;
		for (String s : _allowed_values) {
			allowed_values[i++] = CssIdent.getIdent(s);
		}
	}

	public static CssIdent getAllowedIdent(CssIdent ident) {
		for (CssIdent id : allowed_values) {
			if (id.equals(ident)) {
				return id;
			}
		}
		return null;
	}


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

	/**
	 * Creates a new CssImeMode
	 *
	 * @param expression The expression for this property
	 * @throws org.w3c.css.util.InvalidParamException
	 *          Expressions are incorrect
	 */
	public CssImeMode(ApplContext ac, CssExpression expression, boolean check)
			throws InvalidParamException {
		setByUser();
		CssValue val = expression.getValue();

		if (check && expression.getCount() > 1) {
			throw new InvalidParamException("unrecognize", ac);
		}

		if (val.getType() != CssTypes.CSS_IDENT) {
			throw new InvalidParamException("value",
					expression.getValue(),
					getPropertyName(), ac);
		}
		// ident, so inherit, or allowed value
		if (inherit.equals(val)) {
			value = inherit;
		} else {
			val = getAllowedIdent((CssIdent) val);
			if (val == null) {
				throw new InvalidParamException("value",
						expression.getValue(),
						getPropertyName(), ac);
			}
			value = val;
		}
		expression.next();
	}

	public CssImeMode(ApplContext ac, CssExpression expression)
			throws InvalidParamException {
		this(ac, expression, false);
	}
}
Received on Wednesday, 17 October 2012 08:16:27 UTC

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