2002/css-validator/org/w3c/css/properties/css3 CssTextDecorationStyle.java,NONE,1.1 Css3Style.java,1.50,1.51

Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv16145/css3

Modified Files:
	Css3Style.java 
Added Files:
	CssTextDecorationStyle.java 
Log Message:
text-decoration-style per http://www.w3.org/TR/2012/WD-css3-text-20120814/#text-decoration-style0

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- Css3Style.java	31 Aug 2012 10:04:08 -0000	1.50
+++ Css3Style.java	31 Aug 2012 12:06:32 -0000	1.51
@@ -41,6 +41,7 @@
 import org.w3c.css.properties.css.CssHyphens;
 import org.w3c.css.properties.css.CssOpacity;
 import org.w3c.css.properties.css.CssOverflowWrap;
+import org.w3c.css.properties.css.CssTextDecorationStyle;
 import org.w3c.css.properties.css.CssWordBreak;
 import org.w3c.css.properties.css.CssLineBreak;
 import org.w3c.css.properties.css.CssTextAlignLast;
@@ -142,6 +143,7 @@
 	public CssLineBreak cssLineBreak;
 	public CssTextAlignLast cssTextAlignLast;
 	public CssTextJustify cssTextJustify;
+	public CssTextDecorationStyle cssTextDecorationStyle;
 
 
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
@@ -1399,6 +1401,15 @@
 		return cssHyphens;
 	}
 
+	public CssTextDecorationStyle getTextDecorationStyle() {
+		if (cssTextDecorationStyle == null) {
+			cssTextDecorationStyle =
+					(CssTextDecorationStyle) style.CascadingOrder(
+							new CssTextDecorationStyle(), style, selector);
+		}
+		return cssTextDecorationStyle;
+	}
+
 	///
 
 	public CssTextIndentCSS3 getTextIndentCSS3() {

--- NEW FILE: CssTextDecorationStyle.java ---
// $Id: CssTextDecorationStyle.java,v 1.1 2012/08/31 12:06:32 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-text-20120814/#text-decoration-style0
 */
public class CssTextDecorationStyle extends org.w3c.css.properties.css.CssTextDecorationStyle {

	private static CssIdent[] allowed_values;

	static {
		String id_values[] = {"solid", "double", "dotted", "dashed", "wavy"};
		allowed_values = new CssIdent[id_values.length];
		int i = 0;
		for (String s : id_values) {
			allowed_values[i++] = CssIdent.getIdent(s);
		}
	}

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

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

	/**
	 * Creates a new CssTextDecorationStyle
	 *
	 * @param expression The expression for this property
	 * @throws org.w3c.css.util.InvalidParamException
	 *          Expressions are incorrect
	 */
	public CssTextDecorationStyle(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 = getMatchingIdent((CssIdent) val);
			if (val == null) {
				throw new InvalidParamException("value",
						expression.getValue(),
						getPropertyName(), ac);
			}
			value = val;
		}
		expression.next();
	}

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

}

Received on Friday, 31 August 2012 12:06:40 UTC