CVS 2002/css-validator/org/w3c/css/properties/css3

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

Modified Files:
	CssColumnRuleColor.java 
Log Message:
currentColor handling was not moving the expression count as it should

--- /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssColumnRuleColor.java	2011/10/23 14:42:32	1.8
+++ /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssColumnRuleColor.java	2013/01/12 13:55:10	1.9
@@ -1,4 +1,4 @@
-// $Id: CssColumnRuleColor.java,v 1.8 2011/10/23 14:42:32 ylafon Exp $
+// $Id: CssColumnRuleColor.java,v 1.9 2013/01/12 13:55:10 ylafon Exp $
 // From Sijtsche de Jong (sy.de.jong@let.rug.nl)
 // Rewritten 2010 Yves lafon <ylafon@w3.org>
 //
@@ -20,89 +20,96 @@
 
 public class CssColumnRuleColor extends org.w3c.css.properties.css.CssColumnRuleColor {
 
-    CssValue color;
+	CssValue color;
 
-    /**
-     * Create a new CssColumnRuleColor
-     */
-    public CssColumnRuleColor() {
-        color = initial;
-    }
-
-    /**
-     * Create a new CssColumnRuleColor
-     *
-     * @param expression The expression for this property
-     * @throws org.w3c.css.util.InvalidParamException Incorrect value
-     */
-    public CssColumnRuleColor(ApplContext ac, CssExpression expression,
-                              boolean check) throws InvalidParamException {
-
-        setByUser();
-        CssValue val = expression.getValue();
-
-        if (check && expression.getCount() > 1) {
-            throw new InvalidParamException("unrecognize", ac);
-        }
-        if (inherit.equals(val)) {
-            color = inherit;
-        } else if (currentColor.equals(val)) {
-            color = currentColor;
-        } else {
-            try {
-                // we use the latest version of CssColor, aka CSS3
-                // instead of using CSS21 colors + transparent per spec
-                CssColor tcolor = new CssColor(ac, expression, check);
-                color = tcolor.getColor();
-            } catch (InvalidParamException e) {
-                throw new InvalidParamException("value",
-                        expression.getValue(),
-                        getPropertyName(), ac);
-            }
-        }
-    }
-
-    public CssColumnRuleColor(ApplContext ac, CssExpression expression)
-            throws InvalidParamException {
-        this(ac, expression, false);
-    }
-
-    /**
-     * Compares two properties for equality.
-     *
-     * @param property The other property.
-     */
-    public boolean equals(CssProperty property) {
-        return (property instanceof CssColumnRuleColor &&
-                color.equals(((CssColumnRuleColor) property).color));
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-        return color;
-    }
-
-    /**
-     * Returns true if this property is "softly" inherited
-     */
-    public boolean isSoftlyInherited() {
-        return (inherit.equals(color)||currentColor.equals(color));
-    }
-
-    /**
-     * Returns a string representation of the object
-     */
-    public String toString() {
-        return color.toString();
-    }
-
-    /**
-     * Is the value of this property a default value
-     * It is used by all macro for the function <code>print</code>
-     */
-    public boolean isDefault() {
-        return (initial == color);
-    }
+	/**
+	 * Create a new CssColumnRuleColor
+	 */
+	public CssColumnRuleColor() {
+		color = initial;
+	}
+
+	/**
+	 * Create a new CssColumnRuleColor
+	 *
+	 * @param expression The expression for this property
+	 * @throws org.w3c.css.util.InvalidParamException
+	 *          Incorrect value
+	 */
+	public CssColumnRuleColor(ApplContext ac, CssExpression expression,
+							  boolean check) throws InvalidParamException {
+
+		setByUser();
+		CssValue val = expression.getValue();
+
+		if (check && expression.getCount() > 1) {
+			throw new InvalidParamException("unrecognize", ac);
+		}
+		if (inherit.equals(val)) {
+			if (expression.getCount() > 1) {
+				throw new InvalidParamException("value",
+						val, getPropertyName(), ac);
+			}
+			color = inherit;
+			expression.next();
+		} else if (currentColor.equals(val)) {
+			color = currentColor;
+			expression.next();
+		} else {
+			try {
+				// we use the latest version of CssColor, aka CSS3
+				// instead of using CSS21 colors + transparent per spec
+				CssColor tcolor = new CssColor(ac, expression, check);
+				color = tcolor.getColor();
+			} catch (InvalidParamException e) {
+				throw new InvalidParamException("value",
+						expression.getValue(),
+						getPropertyName(), ac);
+			}
+		}
+	}
+
+	public CssColumnRuleColor(ApplContext ac, CssExpression expression)
+			throws InvalidParamException {
+		this(ac, expression, false);
+	}
+
+	/**
+	 * Compares two properties for equality.
+	 *
+	 * @param property The other property.
+	 */
+	public boolean equals(CssProperty property) {
+		return (property instanceof CssColumnRuleColor &&
+				color.equals(((CssColumnRuleColor) property).color));
+	}
+
+	/**
+	 * Returns the value of this property
+	 */
+	public Object get() {
+		return color;
+	}
+
+	/**
+	 * Returns true if this property is "softly" inherited
+	 */
+	public boolean isSoftlyInherited() {
+		return (inherit.equals(color) || currentColor.equals(color));
+	}
+
+	/**
+	 * Returns a string representation of the object
+	 */
+	public String toString() {
+		return color.toString();
+	}
+
+	/**
+	 * Is the value of this property a default value
+	 * It is used by all macro for the function <code>print</code>
+	 */
+	public boolean isDefault() {
+		return (initial == color);
+	}
 }

Received on Saturday, 12 January 2013 13:55:11 UTC