2002/css-validator/org/w3c/css/properties/css3 CssTextDecoration.java,NONE,1.1 Css3Style.java,1.63,1.64 CssTextDecorationLine.java,1.2,1.3 CssTextEmphasis.java,1.2,1.3 CssTextDecorationCSS3.java,1.4,NONE

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

Modified Files:
	Css3Style.java CssTextDecorationLine.java CssTextEmphasis.java 
Added Files:
	CssTextDecoration.java 
Removed Files:
	CssTextDecorationCSS3.java 
Log Message:
text-decoration per http://www.w3.org/TR/2012/WD-css3-text-20120814/#text-decoration0

Index: CssTextDecorationLine.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssTextDecorationLine.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssTextDecorationLine.java	1 Sep 2012 17:03:17 -0000	1.2
+++ CssTextDecorationLine.java	4 Sep 2012 10:27:55 -0000	1.3
@@ -30,6 +30,9 @@
 	}
 
 	public static final CssIdent getAllowedValue(CssIdent ident) {
+		if (none.equals(ident)) {
+			return none;
+		}
 		if (underline.equals(ident)) {
 			return underline;
 		}

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- Css3Style.java	4 Sep 2012 09:10:58 -0000	1.63
+++ Css3Style.java	4 Sep 2012 10:27:54 -0000	1.64
@@ -98,8 +98,6 @@
 	CssLineHeightPolicy cssLineHeightPolicy;
 	CssLineBoxContain cssLineBoxContain;
 
-
-	CssTextDecorationCSS3 cssTextDecoration;
 	CssAllSpaceTreatment cssAllSpaceTreatment;
 	CssLineGrid cssLineGrid;
 	CssLineGridMode cssLineGridMode;
@@ -621,15 +619,6 @@
 		return cssBackgroundOrigin;
 	}
 
-	public CssTextDecorationCSS3 getCssTextDecoration() {
-		if (cssTextDecoration == null) {
-			cssTextDecoration =
-					(CssTextDecorationCSS3) style.CascadingOrder(
-							new CssTextDecorationCSS3(), style, selector);
-		}
-		return cssTextDecoration;
-	}
-
 	public CssAllSpaceTreatment getAllSpaceTreatment() {
 		if (cssAllSpaceTreatment == null) {
 			cssAllSpaceTreatment =

Index: CssTextEmphasis.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssTextEmphasis.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssTextEmphasis.java	4 Sep 2012 09:14:17 -0000	1.2
+++ CssTextEmphasis.java	4 Sep 2012 10:27:55 -0000	1.3
@@ -10,6 +10,7 @@
 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;
@@ -99,6 +100,10 @@
 						}
 					}
 			}
+			if (op != CssOperator.SPACE) {
+				throw new InvalidParamException("operator",
+						((new Character(op)).toString()), ac);
+			}
 		}
 		// parse the style exp
 		if (styleExp != null) {

--- NEW FILE: CssTextDecoration.java ---
// $Id: CssTextDecoration.java,v 1.1 2012/09/04 10:27:54 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.parser.CssStyle;
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;

/**
 * @spec http://www.w3.org/TR/2011/REC-CSS2-20110607/text.html#propdef-text-decoration
 */
public class CssTextDecoration extends org.w3c.css.properties.css.CssTextDecoration {

	public static final CssIdent blink;

	static {
		blink = CssIdent.getIdent("blink");
	}

	CssTextDecorationLine lineValue = null;
	CssTextDecorationColor colorValue = null;
	CssTextDecorationStyle styleValue = null;

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

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

		CssValue val;
		char op;

		CssIdent styValue = null;
		CssIdent bliValue = null;
		CssValue colValue = null;
		CssExpression linExp = null;

		int state = 0;

		while (!expression.end()) {
			val = expression.getValue();
			op = expression.getOperator();

			if (val.getType() != CssTypes.CSS_IDENT) {
				if (colValue != null) {
					throw new InvalidParamException("value",
							val.toString(),
							getPropertyName(), ac);
				}
				CssColor c = new CssColor(ac, expression, false);
				colValue = c.getColor();
				state *= 2;
				// constructor is providing expression.next()
			} else {
				// so we have an ident...
				CssIdent ident = (CssIdent) val;
				if (inherit.equals(ident)) {
					value = inherit;
					if (check && expression.getCount() != 1) {
						throw new InvalidParamException("value",
								val.toString(),
								getPropertyName(), ac);
					}
					expression.next();
				} else {
					boolean match = false;
					CssIdent id;
					// check for style (single value)
					if (styValue == null) {
						id = CssTextDecorationStyle.getMatchingIdent(ident);
						if (id != null) {
							styValue = id;
							match = true;
							state *= 2;
							expression.next();
						}
					}
					// blink (single value)
					if (!match && bliValue == null) {
						if (blink.equals(ident)) {
							bliValue = blink;
							match = true;
							state *= 2;
							expression.next();
						}
					}
					// line... up to 3 values
					// state should be 0 (nothing yet) or 1 (parsing line)
					// if 2 or more, we got something else in between!
					if (!match && state <= 1) {
						id = CssTextDecorationLine.getAllowedValue(ident);
						if (id != null) {
							state = 1;
							match = true;
							if (linExp == null) {
								linExp = new CssExpression();
							}
							linExp.addValue(val);
							expression.next();
						}
					}
					// if it fails, it must be a color, then...
					if (!match && colValue == null) {
						CssColor c = new CssColor(ac, expression, false);
						colValue = c.getColor();
						state *= 2;
						// no need to check match, as if it is not a color
						// an exception would be fired
					}
				}
			}

			if (op != CssOperator.SPACE) {
				throw new InvalidParamException("operator",
						((new Character(op)).toString()), ac);
			}
		}
		int got = 0;
		// now check the value
		if (linExp != null) {
		   lineValue = new CssTextDecorationLine(ac, linExp, check);
			got++;
			value = lineValue.value;
		}
		// fill the individual values if needed
		if (colValue != null) {
			colorValue = new CssTextDecorationColor();
			colorValue.value = colValue;
			value = colValue;
			got++;
		}
		if (styValue != null) {
			styleValue = new CssTextDecorationStyle();
			styleValue.value = styValue;
			value = styValue;
			got++;
		}
		if (bliValue != null) {
			value = bliValue;
			got++;
		}
		// and generate the value;
		if (value != inherit && got > 1) {
			ArrayList<CssValue> v = new ArrayList<CssValue>(4);
			if (lineValue != null) {
				v.add(lineValue.value);
			}
			if (styValue != null) {
				v.add(styValue);
			}
			if (colValue != null) {
				v.add(colValue);
			}
			if (bliValue != null) {
				v.add(bliValue);
			}
			value = new CssValueList(v);
		}
	}

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

	/**
	 * Add this property to the CssStyle.
	 *
	 * @param style The CssStyle
	 */
	public void addToStyle(ApplContext ac, CssStyle style) {
		super.addToStyle(ac, style);
		// and the individual...
		if (colorValue != null) {
			colorValue.addToStyle(ac, style);
		}
		if (styleValue != null) {
			styleValue.addToStyle(ac, style);
		}
		if (lineValue != null) {
			lineValue.addToStyle(ac, style);
		}
	}
}


--- CssTextDecorationCSS3.java DELETED ---

Received on Tuesday, 4 September 2012 10:28:03 UTC