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

2002/css-validator/org/w3c/css/properties/css1 Css1Style.java,1.25,1.26 CssBackground.java,1.8,1.9 CssBorder.java,1.7,1.8 CssBorderBottom.java,1.6,1.7 CssBorderBottomWidth.java,1.4,1.5 CssBorderColor.java,1.8,1.9 CssBorderLeft.java,1.5,1.6 CssBorderLeftWidth.java,1.4,1.5 CssBorderRight.java,1.5,1.6 CssBorderRightWidth.java,1.4,1.5 CssBorderStyle.java,1.8,1.9 CssBorderTop.java,1.5,1.6 CssBorderTopWidth.java,1.4,1.5 CssBorderWidth.java,1.5,1.6 CssBorderBottomCSS1.java,1.5,NONE CssBorderBottomCSS2.java,1.6,NONE CssBorderBottomColor.java,1.6,NONE CssBorderBottomColorCSS1.java,1.6,NONE CssBorderBottomColorCSS2.java,1.7,NONE CssBorderBottomStyle.java,1.4,NONE CssBorderBottomStyleCSS1.java,1.4,NONE CssBorderBottomStyleCSS2.java,1.4,NONE CssBorderBottomWidthCSS1.java,1.4,NONE CssBorderBottomWidthCSS2.java,1.4,NONE CssBorderCSS1.java,1.5,NONE CssBorderCSS2.java,1.6,NONE CssBorderColorCSS1.java,1.6,NONE CssBorderColorCSS2.java,1.8,NONE CssBorderFaceColor.java,1.4,NONE CssBorderFaceColorCSS1.java,1.5,NONE Css

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 25 Apr 2012 20:22:02 +0000
To: Message-Id: <E1SN8jQ-0006Ly-MU@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css1
In directory hutz:/tmp/cvs-serv23918/w3c/css/properties/css1

Modified Files:
	Css1Style.java CssBackground.java CssBorder.java 
	CssBorderBottom.java CssBorderBottomWidth.java 
	CssBorderColor.java CssBorderLeft.java CssBorderLeftWidth.java 
	CssBorderRight.java CssBorderRightWidth.java 
	CssBorderStyle.java CssBorderTop.java CssBorderTopWidth.java 
	CssBorderWidth.java 
Removed Files:
	CssBorderBottomCSS1.java CssBorderBottomCSS2.java 
	CssBorderBottomColor.java CssBorderBottomColorCSS1.java 
	CssBorderBottomColorCSS2.java CssBorderBottomStyle.java 
	CssBorderBottomStyleCSS1.java CssBorderBottomStyleCSS2.java 
	CssBorderBottomWidthCSS1.java CssBorderBottomWidthCSS2.java 
	CssBorderCSS1.java CssBorderCSS2.java CssBorderColorCSS1.java 
	CssBorderColorCSS2.java CssBorderFaceColor.java 
	CssBorderFaceColorCSS1.java CssBorderFaceColorCSS2.java 
	CssBorderFaceStyle.java CssBorderFaceStyleCSS1.java 
	CssBorderFaceStyleCSS2.java CssBorderFaceWidth.java 
	CssBorderFaceWidthCSS1.java CssBorderFaceWidthCSS2.java 
	CssBorderLeftCSS1.java CssBorderLeftCSS2.java 
	CssBorderLeftColor.java CssBorderLeftColorCSS1.java 
	CssBorderLeftColorCSS2.java CssBorderLeftStyle.java 
	CssBorderLeftStyleCSS1.java CssBorderLeftStyleCSS2.java 
	CssBorderLeftWidthCSS1.java CssBorderLeftWidthCSS2.java 
	CssBorderRightCSS1.java CssBorderRightCSS2.java 
	CssBorderRightColor.java CssBorderRightColorCSS1.java 
	CssBorderRightColorCSS2.java CssBorderRightStyle.java 
	CssBorderRightStyleCSS1.java CssBorderRightStyleCSS2.java 
	CssBorderRightWidthCSS1.java CssBorderRightWidthCSS2.java 
	CssBorderStyleCSS1.java CssBorderStyleCSS2.java 
	CssBorderTopCSS1.java CssBorderTopCSS2.java 
	CssBorderTopColor.java CssBorderTopColorCSS1.java 
	CssBorderTopColorCSS2.java CssBorderTopStyle.java 
	CssBorderTopStyleCSS1.java CssBorderTopStyleCSS2.java 
	CssBorderTopWidthCSS1.java CssBorderTopWidthCSS2.java 
	CssBorderWidthCSS1.java CssBorderWidthCSS2.java 
Log Message:
Finished implementation of css3-background (background and borders)
* border is now a single item, instead of one per level
* able to parse all the positive tests, some negative ones will need some tuning
* Grammar modification to use the '/' between two numbers without matching a ratio 



--- CssBorderTopStyleCSS2.java DELETED ---

--- CssBorderBottomStyleCSS1.java DELETED ---

Index: CssBorderBottomWidth.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderBottomWidth.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBorderBottomWidth.java	5 Jan 2010 13:49:40 -0000	1.4
+++ CssBorderBottomWidth.java	25 Apr 2012 20:21:56 -0000	1.5
@@ -1,158 +1,44 @@
-//
 // $Id$
-// From Philippe Le Hegaret (http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#value-def-border-width
+ * @version $Revision$
+ */
+public class CssBorderBottomWidth extends org.w3c.css.properties.css.CssBorderBottomWidth {
 
-  /**
-   * Add this property to the CssStyle.
-   *
-   * @param style The CssStyle
-   */
-  public void addToStyle(ApplContext ac, CssStyle style) {
-    CssBorderBottom bottom = ((Css1Style) style).cssBorder.bottom;
-    if (bottom.width != null)
-      style.addRedefinitionWarning(ac, this);
-    bottom.width = this;
-  }
+    /**
+     * Create a new CssBorderBottomWidth
+     */
+    public CssBorderBottomWidth() {
+    }
 
-  /**
-   * Get this property in the style.
-   *
-   * @param style The style where the property is
-   * @param resolve if true, resolve the style to find this property
-   */
-  public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
-    if (resolve) {
-      return ((Css1Style) style).getBorderBottomWidth();
-    } else {
-      return ((Css1Style) style).cssBorder.getBottom().width;
+    /**
+     * Creates a new CssBorderBottomWidth
+     *
+     * @param expression The expression for this property
+     * @throws org.w3c.css.util.InvalidParamException
+     *          Expressions are incorrect
+     */
+    public CssBorderBottomWidth(ApplContext ac, CssExpression expression, boolean check)
+            throws InvalidParamException {
+        setByUser();
+        // here we delegate to BorderWidth implementation
+        value = CssBorderWidth.checkBorderSideWidth(ac, this, expression, check);
     }
-  }
 
-  /**
-   * Compares two properties for equality.
-   *
-   * @param value The other property.
-   */
-  public boolean equals(CssProperty property) {
-    return (property instanceof CssBorderBottomWidth && face.equals(((CssBorderBottomWidth) property).face));
-  }
+    public CssBorderBottomWidth(ApplContext ac, CssExpression expression)
+            throws InvalidParamException {
+        this(ac, expression, false);
+    }
 
 }
+

Index: CssBorderStyle.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderStyle.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- CssBorderStyle.java	9 Sep 2011 12:16:44 -0000	1.8
+++ CssBorderStyle.java	25 Apr 2012 20:21:59 -0000	1.9
@@ -1,386 +1,183 @@
-//
 // $Id$
-// From Philippe Le Hegaret (http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#value-def-border-style
  */
-public class CssBorderStyle extends CssProperty implements CssOperator {
+public class CssBorderStyle extends org.w3c.css.properties.css.CssBorderStyle {
+
+    public static CssIdent allowed_values[];
 
-    public static HashSet<CssIdent> acceptable_values;
     static {
-	acceptable_values = new HashSet<CssIdent>();
-	acceptable_values.add(CssIdent.getIdent("none"));
-	acceptable_values.add(CssIdent.getIdent("hidden"));
-	acceptable_values.add(CssIdent.getIdent("dotted"));
-	acceptable_values.add(CssIdent.getIdent("dashed"));
-	acceptable_values.add(CssIdent.getIdent("solid"));
-	acceptable_values.add(CssIdent.getIdent("double"));
-	acceptable_values.add(CssIdent.getIdent("dot-dash"));
-	acceptable_values.add(CssIdent.getIdent("dot-dot-dash"));
-	acceptable_values.add(CssIdent.getIdent("wave"));
-	acceptable_values.add(CssIdent.getIdent("groove"));
-	acceptable_values.add(CssIdent.getIdent("ridge"));
-	acceptable_values.add(CssIdent.getIdent("inset"));
-	acceptable_values.add(CssIdent.getIdent("outset"));
+        String _val[] = {"none", "hidden", "dotted", "dashed", "solid",
+                "double", "groove", "ridge", "inset", "outset"};
+        int i = 0;
+        allowed_values = new CssIdent[_val.length];
+        for (String s : _val) {
+            allowed_values[i++] = CssIdent.getIdent(s);
+
+        }
+    }
+
+    static CssIdent getMatchingIdent(CssIdent ident) {
+        for (CssIdent id : allowed_values) {
+            if (id.equals(ident)) {
+                return id;
+            }
+        }
+        return null;
     }
-    CssBorderTopStyle top;
-    CssBorderBottomStyle bottom;
-    CssBorderRightStyle right;
-    CssBorderLeftStyle left;
 
     /**
      * Create a new CssBorderStyle
      */
-    public CssBorderStyle(CssBorderTopStyle top,
-	    CssBorderBottomStyle bottom,
-	    CssBorderRightStyle right,
-	    CssBorderLeftStyle left) {
-	this.top = top;
-	this.bottom = bottom;
-	this.left = left;
-	this.right = right;
+    public CssBorderStyle() {
     }
 
     /**
-     * Create a new CssBorder
+     * Set the value of the property<br/>
+     * Does not check the number of values
      *
      * @param expression The expression for this property
-     * @exception InvalidParamException Values are incorrect
+     * @throws org.w3c.css.util.InvalidParamException
+     *          The expression is incorrect
      */
-    public CssBorderStyle(ApplContext ac, CssExpression expression,
-	    boolean check) throws InvalidParamException {
-
-	setByUser();
-
-	switch (expression.getCount()) {
-	case 1:
-	    top = new CssBorderTopStyle(ac, expression);
-	    /*bottom = new CssBorderBottomStyle((CssBorderFaceStyle) top.get());
-	    right = new CssBorderRightStyle((CssBorderFaceStyle) top.get());
-	    left = new CssBorderLeftStyle((CssBorderFaceStyle) top.get());*/
-	    break;
-	case 2:
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-			((new Character(expression.getOperator())).toString()),
-			ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    top = new CssBorderTopStyle(ac, expression);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    right = new CssBorderRightStyle(ac, expression);
-	    /*bottom = new CssBorderBottomStyle((CssBorderFaceStyle) top.get());
-	    left = new CssBorderLeftStyle((CssBorderFaceStyle) right.get());*/
-	    break;
-	case 3:
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-			((new Character(expression.getOperator())).toString()),
-			ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    top = new CssBorderTopStyle(ac, expression);
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-			((new Character(expression.getOperator())).toString()),
-			ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    right = new CssBorderRightStyle(ac, expression);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    bottom = new CssBorderBottomStyle(ac, expression);
-	    //left = new CssBorderLeftStyle((CssBorderFaceStyle) right.get());
-	    break;
-	case 4:
-	    if (expression.getOperator() != SPACE) {
-		throw new InvalidParamException("operator",
-			((new Character(expression.getOperator())).toString()),
-			ac);
-	    }
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    top = new CssBorderTopStyle(ac, expression);
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-		    ((new Character(expression.getOperator())).toString()),
-		    ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    right = new CssBorderRightStyle(ac, expression);
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-		    ((new Character(expression.getOperator())).toString()),
-		    ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    bottom = new CssBorderBottomStyle(ac, expression);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    left = new CssBorderLeftStyle(ac, expression);
-	    break;
-	    default:
-		if(check) {
-		    throw new InvalidParamException("unrecognize", ac);
-		}
-	    break;
-	}
-    }
-
     public CssBorderStyle(ApplContext ac, CssExpression expression)
-	throws InvalidParamException {
-	this(ac, expression,false);
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return top;
-    }
-
-    /**
-     * Returns the name of this property
-     */
-    public String getPropertyName() {
-	return "border-style";
-    }
-
-    /**
-     * Returns a string representation of the object.
-     */
-    public String toString() {
-        String result = "";
-        // top should never be null
-        if(top != null) result += top;
-        if(right != null) result += " " + right;
-        if(bottom != null) result += " " + bottom;
-        if(left != null) result += " " + left;
-        return result;
-	/*if (right.face.equals(left.face)) {
-	    if (top.face.equals(bottom.face)) {
-		if (top.face.equals(right.face)) {
-		    return top.toString();
-		} else {
-		    return top + " " + right;
-		}
-	    } else {
-		return top + " " + right + " " + bottom;
-	    }
-	} else {
-	    return top + " " + right + " " + bottom + " " + left;
-	}*/
-    }
-
-    /**
-     * Set this property to be important.
-     * Overrides this method for a macro
-     */
-    public void setImportant() {
-	if(top != null) {
-	    top.important = true;
-	}
-	if(right != null) {
-	    right.important = true;
-	}
-	if(left != null) {
-	    left.important = true;
-	}
-	if(bottom != null) {
-	    bottom.important = true;
-	}
-    }
-
-    /**
-     * Returns true if this property is important.
-     * Overrides this method for a macro
-     */
-    public boolean getImportant() {
-	return ((top == null || top.important) &&
-		(right == null || right.important) &&
-		(left == null || left.important) &&
-		(bottom == null || bottom.important));
+            throws InvalidParamException {
+        this(ac, expression, false);
     }
 
     /**
-     * Set the context.
-     * Overrides this method for a macro
+     * Set the value of the property
      *
-     * @see org.w3c.css.css.CssCascadingOrder#order
-     * @see org.w3c.css.css.StyleSheetParser#handleRule
+     * @param expression The expression for this property
+     * @param check      set it to true to check the number of values
+     * @throws org.w3c.css.util.InvalidParamException
+     *          The expression is incorrect
      */
-    public void setSelectors(CssSelectors selector) {
-	super.setSelectors(selector);
-	if (top != null) {
-	    top.setSelectors(selector);
-	}
-	if (right != null) {
-	    right.setSelectors(selector);
-	}
-	if (bottom != null) {
-	    bottom.setSelectors(selector);
-	}
-	if (left != null) {
-	    left.setSelectors(selector);
-	}
-    }
+    public CssBorderStyle(ApplContext ac, CssExpression expression,
+                          boolean check) throws InvalidParamException {
+        if (check && expression.getCount() > 4) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        setByUser();
+        CssValue val;
+        char op;
 
-    /**
-     * Add this property to the CssStyle
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	if(top != null) {
-	    top.addToStyle(ac , style);
-	}
-	if(right != null) {
-	    right.addToStyle(ac, style);
-	}
-	if(left != null) {
-	    left.addToStyle(ac, style);
-	}
-	if(bottom != null) {
-	    bottom.addToStyle(ac, style);
-	}
-    }
+        ArrayList<CssValue> res = new ArrayList<CssValue>();
+        while (res.size() < 4 && !expression.end()) {
+            val = expression.getValue();
+            op = expression.getOperator();
 
-    /**
-     * Get this property in the style.
-     *
-     * @param style The style where the property is
-     * @param resolve if true, resolve the style to find this property
-     */
-    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
-	throw new IllegalStateException("Can't invoke this method on the property " +
-		getPropertyName());
-    }
+            switch (val.getType()) {
+                case CssTypes.CSS_IDENT:
+                    if (inherit.equals(val)) {
+                        res.add(inherit);
+                        break;
+                    }
+                    CssIdent match = getMatchingIdent((CssIdent) val);
+                    if (match == null) {
+                        throw new InvalidParamException("value", expression.getValue(),
+                                getPropertyName(), ac);
+                    }
+                    res.add(match);
+                    break;
+                default:
+                    throw new InvalidParamException("unrecognize", ac);
+            }
+            expression.next();
+            if (op != SPACE) {
+                throw new InvalidParamException("operator",
+                        Character.toString(op),
+                        ac);
+            }
+        }
+        // check that inherit is alone
+        if (res.size() > 1 && res.contains(inherit)) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        value = (res.size() == 1) ? res.get(0) : new CssValueList(res);
 
-    /**
-     * Update the source file and the line.
-     * Overrides this method for a macro
-     *
-     * @param line The line number where this property is defined
-     * @param source The source file where this property is defined
-     */
-    public void setInfo(int line, String source) {
-	super.setInfo(line, source);
-	if(top != null) {
-	    top.setInfo(line, source);
-	}
-	if(right != null) {
-	    right.setInfo(line, source);
-	}
-	if(left != null) {
-	    left.setInfo(line, source);
-	}
-	if(bottom != null) {
-	    bottom.setInfo(line, source);
-	}
+        // now assign the computed values...
+        top = new CssBorderTopStyle();
+        right = new CssBorderRightStyle();
+        bottom = new CssBorderBottomStyle();
+        left = new CssBorderLeftStyle();
+
+        switch (res.size()) {
+            case 1:
+                top.value = left.value = right.value = bottom.value = res.get(0);
+                break;
+            case 2:
+                top.value = bottom.value = res.get(0);
+                right.value = left.value = res.get(1);
+                break;
+            case 3:
+                top.value = res.get(0);
+                right.value = left.value = res.get(1);
+                bottom.value = res.get(2);
+                break;
+            case 4:
+                top.value = res.get(0);
+                right.value = res.get(1);
+                bottom.value = res.get(2);
+                left.value = res.get(3);
+                break;
+            default:
+                // can't happen
+                throw new InvalidParamException("unrecognize", ac);
+        }
     }
 
     /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
+     * Check the border-*-style and returns a value.
+     * It makes sense to do it only once for all the sides, so by having the code here.
      */
-    public boolean equals(CssProperty property) {
-	return false; // FIXME
+    protected static CssValue checkBorderSideStyle(ApplContext ac, CssProperty caller, CssExpression expression,
+                                                   boolean check) throws InvalidParamException {
+        if (check && expression.getCount() > 1) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        CssValue retval = null;
+        CssValue val = expression.getValue();
+        switch (val.getType()) {
+            case CssTypes.CSS_IDENT:
+                if (inherit.equals(val)) {
+                    retval = inherit;
+                } else {
+                    retval = getMatchingIdent((CssIdent) val);
+                }
+                if (retval == null) {
+                    throw new InvalidParamException("value", expression.getValue(),
+                            caller.getPropertyName(), ac);
+                }
+                break;
+            default:
+                throw new InvalidParamException("unrecognize", ac);
+        }
+        expression.next();
+        return retval;
     }
 
 }

--- CssBorderStyleCSS2.java DELETED ---

--- CssBorderBottomStyle.java DELETED ---

--- CssBorderTopWidthCSS1.java DELETED ---

--- CssBorderFaceStyle.java DELETED ---

--- CssBorderFaceColorCSS2.java DELETED ---

Index: CssBorderLeftWidth.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderLeftWidth.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBorderLeftWidth.java	5 Jan 2010 13:49:41 -0000	1.4
+++ CssBorderLeftWidth.java	25 Apr 2012 20:21:58 -0000	1.5
@@ -1,161 +1,44 @@
-//
 // $Id$
-// From Philippe Le Hegaret (http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#value-def-border-width
  * @version $Revision$
  */
-public class CssBorderLeftWidth extends CssProperty {
-
-    CssBorderFaceWidth face;
+public class CssBorderLeftWidth extends org.w3c.css.properties.css.CssBorderLeftWidth {
 
     /**
      * Create a new CssBorderLeftWidth
      */
     public CssBorderLeftWidth() {
-	face = new CssBorderFaceWidth();
     }
 
     /**
-     * Create a new CssBorderLeftWidth with an another CssBorderFaceWidth
-     *
-     * @param another The another side.
-     */
-    public CssBorderLeftWidth(CssBorderFaceWidth another) {
-	setByUser();
-
-	face = another;
-    }
-
-    /**
-     * Create a new CssBorderLeftWidth
+     * Creates a new CssBorderLeftWidth
      *
-     * @param expression The expression for this property.
-     * @exception InvalidParamException Values are incorrect
+     * @param expression The expression for this property
+     * @throws org.w3c.css.util.InvalidParamException
+     *          Expressions are incorrect
      */
-    public CssBorderLeftWidth(ApplContext ac, CssExpression expression,
-	    boolean check) throws InvalidParamException {
-
-	if(check && expression.getCount() > 1) {
-	    throw new InvalidParamException("unrecognize", ac);
-	}
-
-	setByUser();
-	face = new CssBorderFaceWidth(ac, expression);
+    public CssBorderLeftWidth(ApplContext ac, CssExpression expression, boolean check)
+            throws InvalidParamException {
+        setByUser();
+        // here we delegate to BorderWidth implementation
+        value = CssBorderWidth.checkBorderSideWidth(ac, this, expression, check);
     }
 
     public CssBorderLeftWidth(ApplContext ac, CssExpression expression)
-	throws InvalidParamException {
-	this(ac, expression,false);
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return face;
-    }
-
-    /**
-     * Return the value of this property
-     */
-    public CssValue getValue() {
-	if(face != null) {
-	    return face.getValue();
-	}
-	return null;
-    }
-
-    /**
-     * Returns a string representation of the object.
-     */
-    public String toString() {
-	if(face != null) {
-	    return face.toString();
-	}
-	return "";
-    }
-
-    /**
-     * Returns the name of this property
-     */
-    public String getPropertyName() {
-	return "border-left-width";
-    }
-
-    /**
-     * Add this property to the CssStyle.
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	CssBorderLeft left = ((Css1Style) style).cssBorder.left;
-	if (left.width != null)
-	    style.addRedefinitionWarning(ac, this);
-	left.width = this;
-    }
-
-    /**
-     * Get this property in the style.
-     *
-     * @param style The style where the property is
-     * @param resolve if true, resolve the style to find this property
-     */
-    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
-	if (resolve) {
-	    return ((Css1Style) style).getBorderLeftWidth();
-	} else {
-	    return ((Css1Style) style).cssBorder.getLeft().width;
-	}
-    }
-
-    /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
-     */
-    public boolean equals(CssProperty property) {
-	return (property instanceof CssBorderLeftWidth &&
-		face.equals(((CssBorderLeftWidth) property).face));
+            throws InvalidParamException {
+        this(ac, expression, false);
     }
 
 }
+

--- CssBorderLeftCSS2.java DELETED ---

--- CssBorderRightColorCSS1.java DELETED ---

--- CssBorderRightCSS1.java DELETED ---

--- CssBorderTopStyleCSS1.java DELETED ---

Index: CssBorderLeft.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderLeft.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CssBorderLeft.java	9 Sep 2011 12:16:44 -0000	1.5
+++ CssBorderLeft.java	25 Apr 2012 20:21:57 -0000	1.6
@@ -1,355 +1,95 @@
-//
 // $Id$
-// From Philippe Le Hegaret (http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#border-color-properties
+ */
+public class CssBorderColor extends org.w3c.css.properties.css.CssBorderColor {
 
     /**
-     * Create a new CssBorderColor with all four sides
+     * Create a new CssBorderColor
      */
-    public CssBorderColor(CssBorderTopColor top,
-			  CssBorderBottomColor bottom,
-			  CssBorderRightColor right,
-			  CssBorderLeftColor left) {
-	this.top = top;
-	this.bottom = bottom;
-	this.left = left;
-	this.right = right;
+    public CssBorderColor() {
     }
 
     /**
-     * Create a new CssBorder
+     * Set the value of the property<br/>
+     * Does not check the number of values
      *
      * @param expression The expression for this property
-     * @exception InvalidParamException Values are incorrect
+     * @throws org.w3c.css.util.InvalidParamException
+     *          The expression is incorrect
      */
-    public CssBorderColor(ApplContext ac, CssExpression expression,
-	    boolean check) throws InvalidParamException {
-
-	setByUser();
-
-	switch (expression.getCount()) {
-	case 1:
-	    //CssValue val = expression.floatValue();
-	    //if (val.equals(transparent)) { // obsolete, transparent is a color value now
-		//top = new CssBorderTopColor();
-		//top.face.face = transparent;
-		//expression.next();
-	    //} else
-	    /*if (val.equals(inherit)) {
-		top = new CssBorderTopColor();
-		top.face.face = inherit;
-		expression.next();
-	    } else*/
-	    top = new CssBorderTopColor(ac, expression);
-	    /*bottom = new CssBorderBottomColorCSS21((CssBorderFaceColor) top.get());
-	    right = new CssBorderRightColor((CssBorderFaceColor) top.get());
-	    left = new CssBorderLeftColor((CssBorderFaceColor) top.get());*/
-	    break;
-	case 2:
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-						((new Character(expression.getOperator())).toString()),
-						ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    top = new CssBorderTopColor(ac, expression);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    right = new CssBorderRightColor(ac, expression);
-	    /*bottom = new CssBorderBottomColorCSS21((CssBorderFaceColor) top.get());
-	    left = new CssBorderLeftColor((CssBorderFaceColor) right.get());*/
-	    break;
-	case 3:
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-						((new Character(expression.getOperator())).toString()),
-						ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    top = new CssBorderTopColor(ac, expression);
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-						((new Character(expression.getOperator())).toString()), ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    right = new CssBorderRightColor(ac, expression);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    bottom = new CssBorderBottomColor(ac, expression);
-	    //left = new CssBorderLeftColor((CssBorderFaceColor) right.get());
-	    break;
-	case 4:
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-						((new Character(expression.getOperator())).toString()),
-						ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    top = new CssBorderTopColor(ac, expression);
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-						((new Character(expression.getOperator())).toString()),
-						ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    right = new CssBorderRightColor(ac, expression);
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-						((new Character(expression.getOperator())).toString()),
-						ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    bottom = new CssBorderBottomColor(ac, expression);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    left = new CssBorderLeftColor(ac, expression);
-	    break;
-	default:
-	    if(check) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    break;
-	}
-    }
-
     public CssBorderColor(ApplContext ac, CssExpression expression)
-	throws InvalidParamException {
-	this(ac, expression, false);
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return top;
+            throws InvalidParamException {
+        this(ac, expression, false);
     }
 
     /**
-     * Returns the name of this property
+     * Set the value of the property
+     *
+     * @param expression The expression for this property
+     * @param check      set it to true to check the number of values
+     * @throws org.w3c.css.util.InvalidParamException
+     *          The expression is incorrect
      */
-    public String getPropertyName() {
-	return "border-color";
-    }
+    public CssBorderColor(ApplContext ac, CssExpression expression,
+                          boolean check) throws InvalidParamException {
+        if (check && expression.getCount() > 4) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        setByUser();
+        CssValue val;
+        char op;
 
-    /**
-     * Returns a string representation of the object.
-     */
-    public String toString() {
-        String result = "";
-        // top should never be null
-        if(top != null) result += top;
-        if(right != null) result += " " + right;
-        if(bottom != null) result += " " + bottom;
-        if(left != null) result += " " + left;
-        return result;
-	/*if (right.face.equals(left.face)) {
-	    if (top.face.equals(bottom.face)) {
-		if (top.face.equals(right.face)) {
-		    return top.toString();
-		} else {
-		    return top + " " + right;
-		}
-	    } else {
-		return top + " " + right + " " + bottom;
-	    }
-	} else {
-	    return top + " " + right + " " + bottom + " " + left;
-	}*/
+        ArrayList<CssValue> res = new ArrayList<CssValue>();
+        while (res.size() < 4 && !expression.end()) {
+            val = expression.getValue();
+            op = expression.getOperator();
 
-    }
+            switch (val.getType()) {
+                case CssTypes.CSS_COLOR:
+                    res.add(val);
+                    break;
+                case CssTypes.CSS_IDENT:
+                    if (inherit.equals(val)) {
+                        res.add(inherit);
+                        break;
+                    }
+                    if (transparent.equals(val)) {
+                        res.add(transparent);
+                        break;
+                    }
+                    res.add(new org.w3c.css.values.CssColor(ac, (String)val.get()));
+                    break;
+                default:
+                    throw new InvalidParamException("unrecognize", ac);
+            }
+            expression.next();
+            if (op != SPACE) {
+                throw new InvalidParamException("operator",
+                        Character.toString(op),
+                        ac);
+            }
+        }
+        // check that inherit is alone
+        if (res.size() > 1 && res.contains(inherit)) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        value = (res.size() == 1) ? res.get(0) : new CssValueList(res);
 
-    /**
-     * Set this property to be important.
-     * Overrides this method for a macro
-     */
-    public void setImportant() {
-	if(top != null) {
-	    top.important = true;
-	}
-	if(right != null) {
-	    right.important = true;
-	}
-	if(left != null) {
-	    left.important = true;
-	}
-	if(bottom != null) {
-	    bottom.important = true;
-	}
-    }
+        // now assign the computed values...
+        top = new CssBorderTopColor();
+        right = new CssBorderRightColor();
+        bottom = new CssBorderBottomColor();
+        left = new CssBorderLeftColor();
 
-    /**
-     * Returns true if this property is important.
-     * Overrides this method for a macro
-     */
-    public boolean getImportant() {
-	return ((top == null || top.important) &&
-		(right == null || right.important) &&
-		(left == null || left.important) &&
-		(bottom == null || bottom.important));
-    }
+        switch (res.size()) {
+            case 1:
+                top.value = left.value = right.value = bottom.value = res.get(0);
+                break;
+            case 2:
+                top.value = bottom.value = res.get(0);
+                right.value = left.value = res.get(1);
+                break;
+            case 3:
+                top.value = res.get(0);
+                right.value = left.value = res.get(1);
+                bottom.value = res.get(2);
+                break;
+            case 4:
+                top.value = res.get(0);
+                right.value = res.get(1);
+                bottom.value = res.get(2);
+                left.value = res.get(3);
+                break;
+            default:
+                // can't happen
+                throw new InvalidParamException("unrecognize", ac);
+        }
+        throw new InvalidParamException("unrecognize", ac);
 
-    /**
-     * Set the context.
-     * Overrides this method for a macro
-     *
-     * @see org.w3c.css.css.CssCascadingOrder#order
-     * @see org.w3c.css.css.StyleSheetParser#handleRule
-     */
-    public void setSelectors(CssSelectors selector) {
-	super.setSelectors(selector);
-	if (top != null) {
-	    top.setSelectors(selector);
-	}
-	if (right != null) {
-	    right.setSelectors(selector);
-	}
-	if (bottom != null) {
-	    bottom.setSelectors(selector);
-	}
-	if (left != null) {
-	    left.setSelectors(selector);
-	}
     }
 
     /**
-     * Add this property to the CssStyle
-     *
-     * @param style The CssStyle
+     * Check the border-*-color and returns a value.
+     * It makes sense to do it only once for all the sides, so by having the code here.
      */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	if(top != null) {
-	    top.addToStyle(ac, style);
-	}
-	if(right != null) {
-	    right.addToStyle(ac, style);
-	}
-	if(left != null) {
-	    left.addToStyle(ac, style);
-	}
-	if(bottom != null) {
-	    bottom.addToStyle(ac, style);
-	}
-    }
+    protected static CssValue checkBorderSideColor(ApplContext ac, CssProperty caller, CssExpression expression,
+                                                   boolean check) throws InvalidParamException {
 
-    /**
-     * Get this property in the style.
-     *
-     * @param style The style where the property is
-     * @param resolve if true, resolve the style to find this property
-     */
-    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
-	throw new IllegalStateException("Can't invoke this method on the property " +
-					getPropertyName());
-    }
+        if (check && expression.getCount() > 1) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
 
-    /**
-     * Update the source file and the line.
-     * Overrides this method for a macro
-     *
-     * @param line The line number where this property is defined
-     * @param source The source file where this property is defined
-     */
-    public void setInfo(int line, String source) {
-	super.setInfo(line, source);
-	if(top != null) {
-	    top.setInfo(line, source);
-	}
-	if(right != null) {
-	    right.setInfo(line, source);
-	}
-	if(left != null) {
-	    left.setInfo(line, source);
-	}
-	if(bottom != null) {
-	    bottom.setInfo(line, source);
-	}
-    }
+        CssValue retval = null;
+        CssValue val = expression.getValue();
 
-    /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
-     */
-    public boolean equals(CssProperty property) {
-	return false; // FIXME
+        switch (val.getType()) {
+            case CssTypes.CSS_COLOR:
+                retval = val;
+                break;
+            case CssTypes.CSS_IDENT:
+                if (transparent.equals(val)) {
+                    retval = transparent;
+                    break;
+                }
+                if (inherit.equals(val)) {
+                    retval = inherit;
+                    break;
+                }
+                retval = new org.w3c.css.values.CssColor(ac,
+                        (String) val.get());
+                break;
+            default:
+                throw new InvalidParamException("value", val.toString(),
+                        caller.getPropertyName(), ac);
+        }
+        expression.next();
+        return retval;
     }
-
 }

--- CssBorderCSS1.java DELETED ---

--- CssBorderRightStyle.java DELETED ---

--- CssBorderCSS2.java DELETED ---

--- CssBorderLeftCSS1.java DELETED ---

--- CssBorderBottomColorCSS2.java DELETED ---

--- CssBorderFaceStyleCSS2.java DELETED ---

--- CssBorderLeftStyleCSS1.java DELETED ---

--- CssBorderFaceColor.java DELETED ---

--- CssBorderTopCSS1.java DELETED ---

--- CssBorderFaceWidthCSS1.java DELETED ---

--- CssBorderBottomColorCSS1.java DELETED ---

--- CssBorderLeftStyle.java DELETED ---

--- CssBorderRightColorCSS2.java DELETED ---

Index: CssBorderTopWidth.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderTopWidth.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBorderTopWidth.java	5 Jan 2010 13:49:42 -0000	1.4
+++ CssBorderTopWidth.java	25 Apr 2012 20:22:00 -0000	1.5
@@ -1,163 +1,44 @@
-//
 // $Id$
-// From Philippe Le Hegaret (http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#border-shorthand-properties
  */
-public class CssBorder extends CssProperty implements CssOperator {
-
-//    CssBorderTopWidth width;
-//    CssBorderTopStyle style;
-//    CssBorderTopColor color;
-//    CssValue uri = null;
-//    CssBorderImageTransform imagetransform = null;
-
-    CssBorderTop top = new CssBorderTop();
-    CssBorderRight right = new CssBorderRight();
-    CssBorderBottom bottom = new CssBorderBottom();
-    CssBorderLeft left = new CssBorderLeft();
+public class CssBorder extends org.w3c.css.properties.css.CssBorder {
 
     /**
-     * Create a new CssBorder
+     * Create a new CssBackground
      */
     public CssBorder() {
-	top = new CssBorderTop();
-	right = new CssBorderRight();
-	bottom = new CssBorderBottom();
-	left = new CssBorderLeft();
     }
 
     /**
-     * Create a new CssBorder
+     * Set the value of the property<br/>
+     * Does not check the number of values
      *
-     * @param value The value for this property
-     * @exception InvalidParamException The value is incorrect
+     * @param expression The expression for this property
+     * @throws org.w3c.css.util.InvalidParamException
+     *          The expression is incorrect
      */
-    public CssBorder(ApplContext ac, CssExpression expression,
-	    boolean check) throws InvalidParamException {
-	CssValue val = expression.getValue();
-
-	if(check && expression.getCount() > 4) {
-	    throw new InvalidParamException("unrecognize", ac);
-	}
-
-	setByUser();
-
-
-	top = new CssBorderTop(ac, expression);
-
-	if (val == expression.getValue()) {
-	    throw new InvalidParamException("value",
-					    expression.getValue(),
-					    getPropertyName(), ac);
-	}
-	right = new CssBorderRight();
-	bottom = new CssBorderBottom();
-	left = new CssBorderLeft();
-
-	CssBorderTopWidth w = top.width;
-	CssBorderTopStyle s = top.style;
-	CssBorderTopColor c = top.color;
-
-	if(w != null) {
-	    right.width  =
-		new CssBorderRightWidth((CssBorderFaceWidth) w.get());
-	    left.width =
-		new CssBorderLeftWidth((CssBorderFaceWidth) w.get());
-	    bottom.width =
-		new CssBorderBottomWidth((CssBorderFaceWidth) w.get());
-	}
-	if(s != null) {
-	    right.style =
-		new CssBorderRightStyle((CssBorderFaceStyle) s.get());
-	    left.style =
-		new CssBorderLeftStyle((CssBorderFaceStyle) s.get());
-	    bottom.style =
-		new CssBorderBottomStyle((CssBorderFaceStyle) s.get());
-	}
-	if(c != null) {
-	    right.color =
-		new CssBorderRightColor((CssBorderFaceColor) c.get());
-	    left.color =
-		new CssBorderLeftColor((CssBorderFaceColor) c.get());
-	    bottom.color =
-		new CssBorderBottomColor((CssBorderFaceColor) c.get());
-	}
-	/*
-	CssValue val = expression.floatValue();
-	char op = SPACE;
-	boolean find = true;
-
-	setByUser();
-
-	boolean manyValues = (expression.getCount() > 1);
-
-	while (find) {
-	    find = false;
-	    val = expression.floatValue();
-	    op = expression.getOperator();
-
-	    if (val == null)
-		break;
-
-	    // if there are many values, we can't have inherit as one of them
-	    if(manyValues && val.equals(inherit)) {
-		throw new InvalidParamException("unrecognize", null, null, ac);
-	    }
-
-	    if (op != SPACE)
-		throw new InvalidParamException("operator",
-			((new Character(op)).toString()), ac);
-
-	    if (width == null) {
-		try {
-		    width = new CssBorderTopWidth(ac, expression);
-		    find = true;
-		} catch (InvalidParamException e) {
-		    // nothing to do, style will test the value
-		}
-	    }
-
-	    if (!find && style == null) {
-		try {
-		    style = new CssBorderTopStyle(ac, expression);
-		    find = true;
-		}
-		catch (InvalidParamException e) {
-		    // nothing to do, color will test the value
-		}
-	    }
-
-	    if (!find && color == null) {
-		try {
-		    color = new CssBorderTopColor(ac, expression);
-		    find = true;
-		}
-		catch (InvalidParamException e) {
-		    // nothing to do, uri will test the value
-		}
-	    }
-
-	    if (!find && uri == null) {
-		if (val instanceof CssURL) {
-		    uri = val;
-		    find = true;
-		}
-	    }
-
-	    if (!find && imagetransform == null) {
-		imagetransform = new CssBorderImageTransform(ac, expression);
-		find = true;
-	    }
-	}*/
-	/*
-	if (width == null) {
-	    width = new CssBorderTopWidth();
-	}
-	if (style == null) {
-	    style = new CssBorderTopStyle();
-	}
-
-	if (color == null) {
-	    color = new CssBorderTopColor();
-	}
-	*/
-	//
-
-
-//	top = new CssBorderTop(ac, expression);
-/*
-	right = new CssBorderRight();
-	bottom = new CssBorderBottomCSS21();
-	left = new CssBorderLeft();*/
-/*
-	right.width  =  new CssBorderRightWidth((CssBorderFaceWidth) top.width.get());
-	left.width   =  new CssBorderLeftWidth((CssBorderFaceWidth) top.width.get());
-	bottom.width =  new CssBorderBottomWidth((CssBorderFaceWidth) top.width.get());
-
-	right.style  =  new CssBorderRightStyle((CssBorderFaceStyle) top.style.get());
-	left.style   =  new CssBorderLeftStyle((CssBorderFaceStyle) top.style.get());
-	bottom.style =  new CssBorderBottomStyle((CssBorderFaceStyle) top.style.get());
-
-	right.color  = 	new CssBorderRightColor((CssBorderFaceColor) top.color.get());
-	left.color   =  new CssBorderLeftColor((CssBorderFaceColor) top.color.get());
-	bottom.color =  new CssBorderBottomColorCSS21((CssBorderFaceColor) top.color.get());
-*/
-    }
-
     public CssBorder(ApplContext ac, CssExpression expression)
-	throws InvalidParamException {
-	this(ac, expression, false);
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return top.get();
-    }
-
-    /**
-     * Returns the top property
-     */
-    public CssBorderTop getTop() {
-	return top;
-    }
-
-    /**
-     * Returns the right property
-     */
-    public CssBorderRight getRight() {
-	return right;
-    }
-
-    /**
-     * Returns the bottom property
-     */
-    public CssBorderBottom getBottom() {
-	return bottom;
-    }
-
-    /**
-     * Returns the left property
-     */
-    public CssBorderLeft getLeft() {
-	return left;
+            throws InvalidParamException {
+        this(ac, expression, false);
     }
 
     /**
-     * Returns a string representation of the object.
+     * Set the value of the property
+     *
+     * @param expression The expression for this property
+     * @param check      set it to true to check the number of values
+     * @throws org.w3c.css.util.InvalidParamException
+     *          The expression is incorrect
      */
-    public String toString() {
-	if(top != null) {
-	    return top.toString();
-	}
-	return "";
-    }
+    public CssBorder(ApplContext ac, CssExpression expression,
+                     boolean check) throws InvalidParamException {
+        // great, it's the same thing as one side!
+        SideValues values = checkBorderSide(ac, this, expression, check);
+        CssValueList valueList = new CssValueList();
 
-    public boolean equals(CssProperty property) {
-	return false; // FIXME
+        if (values.color != null) {
+            valueList.add(values.color);
+            borderColor = new CssBorderColor();
+            borderColor.bottom = new CssBorderBottomColor();
+            borderColor.bottom.value = values.color;
+            borderColor.top = new CssBorderTopColor();
+            borderColor.top.value = values.color;
+            borderColor.left = new CssBorderLeftColor();
+            borderColor.left.value = values.color;
+            borderColor.right = new CssBorderRightColor();
+            borderColor.right.value = values.color;
+        }
+        if (values.style != null) {
+            valueList.add(values.style);
+            borderStyle = new CssBorderStyle();
+            borderStyle.bottom = new CssBorderBottomStyle();
+            borderStyle.bottom.value = values.style;
+            borderStyle.top = new CssBorderTopStyle();
+            borderStyle.top.value = values.style;
+            borderStyle.left = new CssBorderLeftStyle();
+            borderStyle.left.value = values.style;
+            borderStyle.right = new CssBorderRightStyle();
+            borderStyle.right.value = values.style;
+        }
+        if (values.width != null) {
+            valueList.add(values.width);
+            borderWidth = new CssBorderWidth();
+            borderWidth.bottom = new CssBorderBottomWidth();
+            borderWidth.bottom.value = values.width;
+            borderWidth.top = new CssBorderTopWidth();
+            borderWidth.top.value = values.width;
+            borderWidth.left = new CssBorderLeftWidth();
+            borderWidth.left.value = values.width;
+            borderWidth.right = new CssBorderRightWidth();
+            borderWidth.right.value = values.width;
+        }
+        value = valueList;
     }
 
     /**
-     * Returns the name of this property
+     * Check the border-* and returns a value.
+     * It makes sense to do it only once for all the sides, so by having the code here.
      */
-    public String getPropertyName() {
-	return "border";
-    }
+    protected static SideValues checkBorderSide(ApplContext ac, CssProperty caller, CssExpression expression,
+                                                boolean check) throws InvalidParamException {
+        if (check && expression.getCount() > 3) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        CssValue _width = null;
+        CssValue _style = null;
+        CssValue _color = null;
 
-    /**
-     * Set this property to be important.
-     * Overrides this method for a macro
-     */
-    public void setImportant() {
-	if(top != null) {
-	    top.setImportant();
-	}
-	if(right != null) {
-	    right.setImportant();
-	}
-	if(left != null) {
-	    left.setImportant();
-	}
-	if(bottom != null) {
-	    bottom.setImportant();
-	}
-    }
+        CssValue val;
+        char op;
 
-    /**
-     * Returns true if this property is important.
-     * Overrides this method for a macro
-     */
-    public boolean getImportant() {
-	return (top.getImportant() &&
-		right.getImportant() &&
-		left.getImportant() &&
-		bottom.getImportant());
-    }
+        while (!expression.end()) {
+            val = expression.getValue();
+            op = expression.getOperator();
 
-    /**
-     * Set the context.
-     * Overrides this method for a macro
-     *
-     * @see org.w3c.css.css.CssCascadingOrder#order
-     * @see org.w3c.css.css.StyleSheetParser#handleRule
-     */
-    public void setSelectors(CssSelectors selector) {
-	super.setSelectors(selector);
-	if (top != null) {
-	    top.setSelectors(selector);
-	}
-	if (right != null) {
-	    right.setSelectors(selector);
-	}
-	if (bottom != null) {
-	    bottom.setSelectors(selector);
-	}
-	if (left != null) {
-	    left.setSelectors(selector);
-	}
+            switch (val.getType()) {
+                case CssTypes.CSS_NUMBER:
+                    val = ((CssNumber) val).getLength();
+                case CssTypes.CSS_LENGTH:
+                    CssLength length = (CssLength) val;
+                    if (!length.isPositive()) {
+                        throw new InvalidParamException("negative-value", expression.getValue(),
+                                caller.getPropertyName(), ac);
+                    }
+                    _width = val;
+                    break;
+                case CssTypes.CSS_COLOR:
+                    _color = val;
+                    break;
+                case CssTypes.CSS_IDENT:
+                    CssIdent id = (CssIdent) val;
+                    if (transparent.equals(id)) {
+                        _color = transparent;
+                        break;
+                    }
+                    if (inherit.equals(id)) {
+                        if (expression.getCount() > 1) {
+                            throw new InvalidParamException("unrecognize", ac);
+                        }
+                        _width = inherit;
+                        _style = inherit;
+                        _color = inherit;
+                        break;
+                    }
+                    CssIdent match = CssBorderWidth.getMatchingIdent(id);
+                    if (match != null) {
+                        _width = match;
+                    } else {
+                        match = CssBorderStyle.getMatchingIdent(id);
+                        if (match != null) {
+                            _style = match;
+                        } else {
+                            // if not a width or a style, fail if it's not a proper color
+                            _color = new org.w3c.css.values.CssColor(ac, id.toString());
+                        }
+                    }
+                    break;
+                default:
+                    throw new InvalidParamException("value", val.toString(),
+                            caller.getPropertyName(), ac);
+            }
+            expression.next();
+            if (op != SPACE) {
+                throw new InvalidParamException("operator",
+                        Character.toString(op),
+                        ac);
+            }
+        }
+        return new SideValues(_width, _style, _color);
     }
 
-    /**
-     * Add this property to the CssStyle
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	if(top != null) {
-	    top.addToStyle(ac, style);
-	}
-	if(right != null) {
-	    right.addToStyle(ac, style);
-	}
-	if(left != null) {
-	    left.addToStyle(ac, style);
-	}
-	if(bottom != null) {
-	    bottom.addToStyle(ac, style);
-	}
-    }
+// small wrapper to return values...
+protected static class SideValues {
+    CssValue width;
+    CssValue style;
+    CssValue color;
 
-    /**
-     * Get this property in the style.
-     *
-     * @param style The style where the property is
-     * @param resolve if true, resolve the style to find this property
-     */
-    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
-	if (resolve) {
-	    return ((Css1Style) style).getBorder();
-	} else {
-	    return ((Css1Style) style).cssBorder;
-	}
-    }
+    SideValues(CssValue width, CssValue style, CssValue color) {
+        this.width = width;
+        this.style = style;
+        this.color = color;
 
-    /**
-     * Update the source file and the line.
-     * Overrides this method for a macro
-     *
-     * @param line The line number where this property is defined
-     * @param source The source file where this property is defined
-     */
-    public void setInfo(int line, String source) {
-	//super.setInfo(line, source);
-	//top.setInfo(line, source);
-	//right.setInfo(line, source);
-	//left.setInfo(line, source);
-	//bottom.setInfo(line, source);
     }
 
-    void check() {
-	//top.check();
-	//bottom.check();
-	//right.check();
-	//left.check();
-    }
+}
 }

--- CssBorderBottomColor.java DELETED ---

--- CssBorderFaceWidthCSS2.java DELETED ---

--- CssBorderTopColor.java DELETED ---

--- CssBorderTopColorCSS2.java DELETED ---

Index: Css1Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/Css1Style.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Css1Style.java	9 Feb 2012 17:36:28 -0000	1.25
+++ Css1Style.java	25 Apr 2012 20:21:55 -0000	1.26
@@ -105,9 +105,8 @@
     /**
      * border properties
      */
-    public CssBorder cssBorder = new CssBorder();
-    public CssBorderCSS2 cssBorderCSS2 = new CssBorderCSS2();
-    public CssBorderCSS1 cssBorderCSS1 = new CssBorderCSS1();
+    public org.w3c.css.properties.css.CssBorder cssBorder = new org.w3c.css.properties.css.CssBorder(true);
+
     /**
      * width property
      */
@@ -609,6 +608,7 @@
         return cssBackground.image;
     }
 
+    // TODO this one has to go as well
     public final CssBackgroundImageMob getBackgroundImageMob() {
         if (cssBackgroundMob.image == null) {
             cssBackgroundMob.image =
@@ -653,6 +653,7 @@
         return cssBackground.attachment;
     }
 
+    // TODO this one has to go as well
     public final CssBackgroundAttachmentMob getBackgroundAttachmentMob() {
         if (cssBackgroundMob.attachment == null) {
             cssBackgroundMob.attachment =
@@ -674,6 +675,7 @@
         return cssBackground.position;
     }
 
+    // TODO this one has to go as well
     public final CssBackgroundPositionMob getBackgroundPositionMob() {
         if (cssBackgroundMob.position == null) {
             cssBackgroundMob.position =
@@ -1041,638 +1043,59 @@
     /**
      * Get the border-top-width property
      */
-    public final CssBorderTopWidth getBorderTopWidth() {
-        if (cssBorder.getTop().getWidth() == null) {
-            cssBorder.getTop().width =
-                    (CssBorderTopWidth) style.CascadingOrder(new CssBorderTopWidth(),
-                            style, selector);
-        }
-        return cssBorder.getTop().width;
-    }
-
-    public final CssBorderTopWidthCSS2 getBorderTopWidthCSS2() {
-        if (cssBorderCSS2.getTop().getWidth() == null) {
-            cssBorderCSS2.getTop().width =
-                    (CssBorderTopWidthCSS2) style.CascadingOrder(new CssBorderTopWidthCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getTop().width;
-    }
-
-    public final CssBorderTopWidthCSS1 getBorderTopWidthCSS1() {
-        if (cssBorderCSS1.getTop().getWidth() == null) {
-            cssBorderCSS1.getTop().width =
-                    (CssBorderTopWidthCSS1) style.CascadingOrder(new CssBorderTopWidthCSS1(),
-                            style, selector);
-        }
-        return cssBorderCSS1.getTop().width;
-    }
-
-    /**
-     * Get the border-top-style property
-     */
-    public final CssBorderTopStyle getBorderTopStyle() {
-        if (cssBorder.getTop().getStyle() == null) {
-            cssBorder.getTop().style =
-                    (CssBorderTopStyle) style.CascadingOrder(new CssBorderTopStyle(),
-                            style, selector);
-        }
-        return cssBorder.getTop().style;
-    }
-
-    public final CssBorderTopStyleCSS2 getBorderTopStyleCSS2() {
-        if (cssBorderCSS2.getTop().getStyle() == null) {
-            cssBorderCSS2.getTop().style =
-                    (CssBorderTopStyleCSS2) style.CascadingOrder(new CssBorderTopStyleCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getTop().style;
-    }
-
-    public final CssBorderTopStyleCSS1 getBorderTopStyleCSS1() {
-        if (cssBorderCSS1.getTop().getStyle() == null) {
-            cssBorderCSS1.getTop().style =
-                    (CssBorderTopStyleCSS1) style.CascadingOrder(new CssBorderTopStyleCSS1(),
-                            style, selector);
-        }
-        return cssBorderCSS1.getTop().style;
-    }
-
-    /**
-     * Get the border-top-color property
-     */
-    public final CssBorderTopColorCSS2 getBorderTopColorCSS2() {
-        if (cssBorderCSS2.getTop().getColor() == null) {
-            cssBorderCSS2.getTop().color =
-                    (CssBorderTopColorCSS2) style.CascadingOrder(new CssBorderTopColorCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getTop().color;
-    }
-
-    public final CssBorderTopColor getBorderTopColor() {
-        if (cssBorder.getTop().getColor() == null) {
-            cssBorder.getTop().color =
-                    (CssBorderTopColor) style.CascadingOrder(new CssBorderTopColor(),
-                            style, selector);
-        }
-        return cssBorder.getTop().color;
-    }
-
-    public final CssBorderTopColorCSS1 getBorderTopColorCSS1() {
-        if (cssBorderCSS1.getTop().getColor() == null) {
-            cssBorderCSS1.getTop().color =
-                    (CssBorderTopColorCSS1) style.CascadingOrder(new CssBorderTopColorCSS1(),
+    public final org.w3c.css.properties.css.CssBorderTopWidth getBorderTopWidth() {
+        if (cssBorder.borderWidth.top == null) {
+            cssBorder.borderWidth.top =
+                    (org.w3c.css.properties.css.CssBorderTopWidth) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderTopWidth(),
                             style, selector);
         }
-        return cssBorderCSS1.getTop().color;
+        return cssBorder.borderWidth.top;
     }
 
     /**
      * Get the border-right-width property
      */
-    public final CssBorderRightWidth getBorderRightWidth() {
-        if (cssBorder.getRight().getWidth() == null) {
-            cssBorder.getRight().width =
-                    (CssBorderRightWidth) style.CascadingOrder(new CssBorderRightWidth(),
-                            style, selector);
-        }
-        return cssBorder.getRight().width;
-    }
-
-    public final CssBorderRightWidthCSS2 getBorderRightWidthCSS2() {
-        if (cssBorderCSS2.getRight().getWidth() == null) {
-            cssBorderCSS2.getRight().width =
-                    (CssBorderRightWidthCSS2) style.CascadingOrder(new CssBorderRightWidthCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getRight().width;
-    }
-
-    public final CssBorderRightWidthCSS1 getBorderRightWidthCSS1() {
-        if (cssBorderCSS1.getRight().getWidth() == null) {
-            cssBorderCSS1.getRight().width =
-                    (CssBorderRightWidthCSS1) style.CascadingOrder(new CssBorderRightWidthCSS1(),
-                            style, selector);
-        }
-        return cssBorderCSS1.getRight().width;
-    }
-
-    /**
-     * Get the border-right-style property
-     */
-    public final CssBorderRightStyle getBorderRightStyle() {
-        if (cssBorder.getRight().getStyle() == null) {
-            cssBorder.getRight().style =
-                    (CssBorderRightStyle) style.CascadingOrder(new CssBorderRightStyle(),
-                            style, selector);
-        }
-        return cssBorder.getRight().style;
-    }
-
-    public final CssBorderRightStyleCSS2 getBorderRightStyleCSS2() {
-        if (cssBorderCSS2.getRight().getStyle() == null) {
-            cssBorderCSS2.getRight().style =
-                    (CssBorderRightStyleCSS2) style.CascadingOrder(new CssBorderRightStyleCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getRight().style;
-    }
-
-    public final CssBorderRightStyleCSS1 getBorderRightStyleCSS1() {
-        if (cssBorderCSS1.getRight().getStyle() == null) {
-            cssBorderCSS1.getRight().style =
-                    (CssBorderRightStyleCSS1) style.CascadingOrder(new CssBorderRightStyleCSS1(),
-                            style, selector);
-        }
-        return cssBorderCSS1.getRight().style;
-    }
-
-    /**
-     * Get the border-right-color property
-     */
-    public final CssBorderRightColor getBorderRightColor() {
-        if (cssBorder.getRight().getColor() == null) {
-            cssBorder.getRight().color =
-                    (CssBorderRightColor) style.CascadingOrder(new CssBorderRightColor(),
-                            style, selector);
-        }
-        return cssBorder.getRight().color;
-    }
-
-    public final CssBorderRightColorCSS2 getBorderRightColorCSS2() {
-        if (cssBorderCSS2.getRight().getColor() == null) {
-            cssBorderCSS2.getRight().color =
-                    (CssBorderRightColorCSS2) style.CascadingOrder(new CssBorderRightColorCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getRight().color;
-    }
-
-    public final CssBorderRightColorCSS1 getBorderRightColorCSS1() {
-        if (cssBorderCSS1.getRight().getColor() == null) {
-            cssBorderCSS1.getRight().color =
-                    (CssBorderRightColorCSS1) style.CascadingOrder(new CssBorderRightColorCSS1(),
+    public final org.w3c.css.properties.css.CssBorderRightWidth getBorderRightWidth() {
+        if (cssBorder.borderWidth.right == null) {
+            cssBorder.borderWidth.right =
+                    (org.w3c.css.properties.css.CssBorderRightWidth) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderRightWidth(),
                             style, selector);
         }
-        return cssBorderCSS1.getRight().color;
+        return cssBorder.borderWidth.right;
     }
 
     /**
      * Get the border-bottom-width property
      */
-    public final CssBorderBottomWidth getBorderBottomWidth() {
-        if (cssBorder.getBottom().getWidth() == null) {
-            cssBorder.getBottom().width =
-                    (CssBorderBottomWidth) style.CascadingOrder(new CssBorderBottomWidth(),
-                            style, selector);
-        }
-        return cssBorder.getBottom().width;
-    }
-
-    public final CssBorderBottomWidthCSS2 getBorderBottomWidthCSS2() {
-        if (cssBorderCSS2.getBottom().getWidth() == null) {
-            cssBorderCSS2.getBottom().width =
-                    (CssBorderBottomWidthCSS2) style.CascadingOrder(new CssBorderBottomWidthCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getBottom().width;
-    }
-
-    public final CssBorderBottomWidthCSS1 getBorderBottomWidthCSS1() {
-        if (cssBorderCSS1.getBottom().getWidth() == null) {
-            cssBorderCSS1.getBottom().width =
-                    (CssBorderBottomWidthCSS1) style.CascadingOrder(new CssBorderBottomWidthCSS1(),
-                            style, selector);
-        }
-        return cssBorderCSS1.getBottom().width;
-    }
-
-    /**
-     * Get the border-bottom-style property
-     */
-    public final CssBorderBottomStyle getBorderBottomStyle() {
-        if (cssBorder.getBottom().getStyle() == null) {
-            cssBorder.getBottom().style =
-                    (CssBorderBottomStyle) style.CascadingOrder(new CssBorderBottomStyle(),
-                            style, selector);
-        }
-        return cssBorder.getBottom().style;
-    }
-
-    public final CssBorderBottomStyleCSS2 getBorderBottomStyleCSS2() {
-        if (cssBorderCSS2.getBottom().getStyle() == null) {
-            cssBorderCSS2.getBottom().style =
-                    (CssBorderBottomStyleCSS2) style.CascadingOrder(new CssBorderBottomStyleCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getBottom().style;
-    }
-
-    public final CssBorderBottomStyleCSS1 getBorderBottomStyleCSS1() {
-        if (cssBorderCSS1.getBottom().getStyle() == null) {
-            cssBorderCSS1.getBottom().style =
-                    (CssBorderBottomStyleCSS1) style.CascadingOrder(new CssBorderBottomStyleCSS1(),
-                            style, selector);
-        }
-        return cssBorderCSS1.getBottom().style;
-    }
-
-    /**
-     * Get the border-bottom-color property
-     */
-    public final CssBorderBottomColor getBorderBottomColor() {
-        if (cssBorder.getBottom().getColor() == null) {
-            cssBorder.getBottom().color =
-                    (CssBorderBottomColor) style.CascadingOrder(new CssBorderBottomColor(),
-                            style, selector);
-        }
-        return cssBorder.getBottom().color;
-    }
-
-    public final CssBorderBottomColorCSS2 getBorderBottomColorCSS2() {
-        if (cssBorderCSS2.getBottom().getColor() == null) {
-            cssBorderCSS2.getBottom().color =
-                    (CssBorderBottomColorCSS2) style.CascadingOrder(new CssBorderBottomColorCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getBottom().color;
-    }
-
-    public final CssBorderBottomColorCSS1 getBorderBottomColorCSS1() {
-        if (cssBorderCSS1.getBottom().getColor() == null) {
-            cssBorderCSS1.getBottom().color =
-                    (CssBorderBottomColorCSS1) style.CascadingOrder(new CssBorderBottomColorCSS1(),
+    public final org.w3c.css.properties.css.CssBorderBottomWidth getBorderBottomWidth() {
+        if (cssBorder.borderWidth.bottom == null) {
+            cssBorder.borderWidth.bottom =
+                    (org.w3c.css.properties.css.CssBorderBottomWidth) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderBottomWidth(),
                             style, selector);
         }
-        return cssBorderCSS1.getBottom().color;
+        return cssBorder.borderWidth.bottom;
     }
 
     /**
      * Get the border-left-width property
      */
-    public final CssBorderLeftWidth getBorderLeftWidth() {
-        if (cssBorder.getLeft().getWidth() == null) {
-            cssBorder.getLeft().width =
-                    (CssBorderLeftWidth) style.CascadingOrder(new CssBorderLeftWidth(),
-                            style, selector);
-        }
-        return cssBorder.getLeft().width;
-    }
-
-    public final CssBorderLeftWidthCSS2 getBorderLeftWidthCSS2() {
-        if (cssBorderCSS2.getLeft().getWidth() == null) {
-            cssBorderCSS2.getLeft().width =
-                    (CssBorderLeftWidthCSS2) style.CascadingOrder(new CssBorderLeftWidthCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getLeft().width;
-    }
-
-    public final CssBorderLeftWidthCSS1 getBorderLeftWidthCSS1() {
-        if (cssBorderCSS1.getLeft().getWidth() == null) {
-            cssBorderCSS1.getLeft().width =
-                    (CssBorderLeftWidthCSS1) style.CascadingOrder(new CssBorderLeftWidthCSS1(),
-                            style, selector);
-        }
-        return cssBorderCSS1.getLeft().width;
-    }
-
-    /**
-     * Get the border-left-style property
-     */
-    public final CssBorderLeftStyle getBorderLeftStyle() {
-        if (cssBorder.getLeft().getStyle() == null) {
-            cssBorder.getLeft().style =
-                    (CssBorderLeftStyle) style.CascadingOrder(new CssBorderLeftStyle(),
-                            style, selector);
-        }
-        return cssBorder.getLeft().style;
-    }
-
-    public final CssBorderLeftStyleCSS2 getBorderLeftStyleCSS2() {
-        if (cssBorderCSS2.getLeft().getStyle() == null) {
-            cssBorderCSS2.getLeft().style =
-                    (CssBorderLeftStyleCSS2) style.CascadingOrder(new CssBorderLeftStyleCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getLeft().style;
-    }
-
-    public final CssBorderLeftStyleCSS1 getBorderLeftStyleCSS1() {
-        if (cssBorderCSS1.getLeft().getStyle() == null) {
-            cssBorderCSS1.getLeft().style =
-                    (CssBorderLeftStyleCSS1) style.CascadingOrder(new CssBorderLeftStyleCSS1(),
-                            style, selector);
-        }
-        return cssBorderCSS1.getLeft().style;
-    }
-
-    /**
-     * Get the border-left-color property
-     */
-    public final CssBorderLeftColor getBorderLeftColor() {
-        if (cssBorder.getLeft().getColor() == null) {
-            cssBorder.getLeft().color =
-                    (CssBorderLeftColor) style.CascadingOrder(new CssBorderLeftColor(),
-                            style, selector);
-        }
-        return cssBorder.getLeft().color;
-    }
-
-    public final CssBorderLeftColorCSS2 getBorderLeftColorCSS2() {
-        if (cssBorderCSS2.getLeft().getColor() == null) {
-            cssBorderCSS2.getLeft().color =
-                    (CssBorderLeftColorCSS2) style.CascadingOrder(new CssBorderLeftColorCSS2(),
-                            style, selector);
-        }
-        return cssBorderCSS2.getLeft().color;
-    }
-
-    public final CssBorderLeftColorCSS1 getBorderLeftColorCSS1() {
-        if (cssBorderCSS1.getLeft().getColor() == null) {
-            cssBorderCSS1.getLeft().color =
-                    (CssBorderLeftColorCSS1) style.CascadingOrder(new CssBorderLeftColorCSS1(),
+    public final org.w3c.css.properties.css.CssBorderLeftWidth getBorderLeftWidth() {
+        if (cssBorder.borderWidth.left == null) {
+            cssBorder.borderWidth.left =
+                    (org.w3c.css.properties.css.CssBorderLeftWidth) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderLeftWidth(),
                             style, selector);
         }
-        return cssBorderCSS1.getLeft().color;
-    }
-
-    /**
-     * Get the border-top property
-     */
-    public final CssBorderTop getBorderTop() {
-        if (cssBorder.getTop().getWidth() == null) {
-            cssBorder.getTop().width = getBorderTopWidth();
-        }
-        if (cssBorder.getTop().getStyle() == null) {
-            cssBorder.getTop().style = getBorderTopStyle();
-        }
-        if (cssBorder.getTop().getColor() == null) {
-            cssBorder.getTop().color = getBorderTopColor();
-        }
-        return cssBorder.getTop();
-    }
-
-    public final CssBorderTopCSS2 getBorderTopCSS2() {
-        if (cssBorderCSS2.getTop().getWidth() == null) {
-            cssBorderCSS2.getTop().width = getBorderTopWidthCSS2();
-        }
-        if (cssBorderCSS2.getTop().getStyle() == null) {
-            cssBorderCSS2.getTop().style = getBorderTopStyleCSS2();
-        }
-        if (cssBorderCSS2.getTop().getColor() == null) {
-            cssBorderCSS2.getTop().color = getBorderTopColorCSS2();
-        }
-        return cssBorderCSS2.getTop();
-    }
-
-    public final CssBorderTopCSS1 getBorderTopCSS1() {
-        if (cssBorderCSS1.getTop().getWidth() == null) {
-            cssBorderCSS1.getTop().width = getBorderTopWidthCSS1();
-        }
-        if (cssBorderCSS1.getTop().getStyle() == null) {
-            cssBorderCSS1.getTop().style = getBorderTopStyleCSS1();
-        }
-        if (cssBorderCSS1.getTop().getColor() == null) {
-            cssBorderCSS1.getTop().color = getBorderTopColorCSS1();
-        }
-        return cssBorderCSS1.getTop();
-    }
-
-    /**
-     * Get the border-right property
-     */
-    public final CssBorderRight getBorderRight() {
-        if (cssBorder.getRight().getWidth() == null) {
-            cssBorder.getRight().width = getBorderRightWidth();
-        }
-        if (cssBorder.getRight().getStyle() == null) {
-            cssBorder.getRight().style = getBorderRightStyle();
-        }
-        if (cssBorder.getRight().getColor() == null) {
-            cssBorder.getRight().color = getBorderRightColor();
-        }
-        return cssBorder.getRight();
-    }
-
-    public final CssBorderRightCSS2 getBorderRightCSS2() {
-        if (cssBorderCSS2.getRight().getWidth() == null) {
-            cssBorderCSS2.getRight().width = getBorderRightWidthCSS2();
-        }
-        if (cssBorderCSS2.getRight().getStyle() == null) {
-            cssBorderCSS2.getRight().style = getBorderRightStyleCSS2();
-        }
-        if (cssBorderCSS2.getRight().getColor() == null) {
-            cssBorderCSS2.getRight().color = getBorderRightColorCSS2();
-        }
-        return cssBorderCSS2.getRight();
-    }
-
-    public final CssBorderRightCSS1 getBorderRightCSS1() {
-        if (cssBorderCSS1.getRight().getWidth() == null) {
-            cssBorderCSS1.getRight().width = getBorderRightWidthCSS1();
-        }
-        if (cssBorderCSS1.getRight().getStyle() == null) {
-            cssBorderCSS1.getRight().style = getBorderRightStyleCSS1();
-        }
-        if (cssBorderCSS1.getRight().getColor() == null) {
-            cssBorderCSS1.getRight().color = getBorderRightColorCSS1();
-        }
-        return cssBorderCSS1.getRight();
-    }
-
-    /**
-     * Get the border-bottom property
-     */
-    public final CssBorderBottom getBorderBottom() {
-        if (cssBorder.getBottom().getWidth() == null) {
-            cssBorder.getBottom().width = getBorderBottomWidth();
-        }
-        if (cssBorder.getBottom().getStyle() == null) {
-            cssBorder.getBottom().style = getBorderBottomStyle();
-        }
-        if (cssBorder.getBottom().getColor() == null) {
-            cssBorder.getBottom().color = getBorderBottomColor();
-        }
-        return cssBorder.getBottom();
-    }
-
-    public final CssBorderBottomCSS2 getBorderBottomCSS2() {
-        if (cssBorderCSS2.getBottom().getWidth() == null) {
-            cssBorderCSS2.getBottom().width = getBorderBottomWidthCSS2();
-        }
-        if (cssBorderCSS2.getBottom().getStyle() == null) {
-            cssBorderCSS2.getBottom().style = getBorderBottomStyleCSS2();
-        }
-        if (cssBorderCSS2.getBottom().getColor() == null) {
-            cssBorderCSS2.getBottom().color = getBorderBottomColorCSS2();
-        }
-        return cssBorderCSS2.getBottom();
-    }
-
-    public final CssBorderBottomCSS1 getBorderBottomCSS1() {
-        if (cssBorderCSS1.getBottom().getWidth() == null) {
-            cssBorderCSS1.getBottom().width = getBorderBottomWidthCSS1();
-        }
-        if (cssBorderCSS1.getBottom().getStyle() == null) {
-            cssBorderCSS1.getBottom().style = getBorderBottomStyleCSS1();
-        }
-        if (cssBorderCSS1.getBottom().getColor() == null) {
-            cssBorderCSS1.getBottom().color = getBorderBottomColorCSS1();
-        }
-        return cssBorderCSS1.getBottom();
-    }
-
-    /**
-     * Get the border-left property
-     */
-    public final CssBorderLeft getBorderLeft() {
-        if (cssBorder.getLeft().getWidth() == null) {
-            cssBorder.getLeft().width = getBorderLeftWidth();
-        }
-        if (cssBorder.getLeft().getStyle() == null) {
-            cssBorder.getLeft().style = getBorderLeftStyle();
-        }
-        if (cssBorder.getLeft().getColor() == null) {
-            cssBorder.getLeft().color = getBorderLeftColor();
-        }
-        return cssBorder.getLeft();
-    }
-
-    public final CssBorderLeftCSS2 getBorderLeftCSS2() {
-        if (cssBorderCSS2.getLeft().getWidth() == null) {
-            cssBorderCSS2.getLeft().width = getBorderLeftWidthCSS2();
-        }
-        if (cssBorderCSS2.getLeft().getStyle() == null) {
-            cssBorderCSS2.getLeft().style = getBorderLeftStyleCSS2();
-        }
-        if (cssBorderCSS2.getLeft().getColor() == null) {
-            cssBorderCSS2.getLeft().color = getBorderLeftColorCSS2();
-        }
-        return cssBorderCSS2.getLeft();
+        return cssBorder.borderWidth.left;
     }
 
-    public final CssBorderLeftCSS1 getBorderLeftCSS1() {
-        if (cssBorderCSS1.getLeft().getWidth() == null) {
-            cssBorderCSS1.getLeft().width = getBorderLeftWidthCSS1();
-        }
-        if (cssBorderCSS1.getLeft().getStyle() == null) {
-            cssBorderCSS1.getLeft().style = getBorderLeftStyleCSS1();
-        }
-        if (cssBorderCSS1.getLeft().getColor() == null) {
-            cssBorderCSS1.getLeft().color = getBorderLeftColorCSS1();
-        }
-        return cssBorderCSS1.getLeft();
-    }
 
     /**
      * Get the border property
      */
-    public final CssBorder getBorder() {
-        getBorderTop();
-        getBorderRight();
-        getBorderBottom();
-        getBorderLeft();
+    public final org.w3c.css.properties.css.CssBorder getBorder() {
         return cssBorder;
     }
 
-    public final CssBorderCSS2 getBorderCSS2() {
-        getBorderTopCSS2();
-        getBorderRightCSS2();
-        getBorderBottomCSS2();
-        getBorderLeftCSS2();
-        return cssBorderCSS2;
-    }
-
-    public final CssBorderCSS1 getBorderCSS1() {
-        getBorderTopCSS1();
-        getBorderRightCSS1();
-        getBorderBottomCSS1();
-        getBorderLeftCSS1();
-        return cssBorderCSS1;
-    }
-
-    /**
-     * Get the border-width property
-     */
-    public final CssBorderWidth getBorderWidth() {
-        // WARNING invalid fields in this property ....
-        return new CssBorderWidth(getBorderTopWidth(),
-                getBorderBottomWidth(),
-                getBorderRightWidth(),
-                getBorderLeftWidth());
-    }
-
-    public final CssBorderWidthCSS2 getBorderWidthCSS2() {
-        // WARNING invalid fields in this property ....
-        return new CssBorderWidthCSS2(getBorderTopWidthCSS2(),
-                getBorderBottomWidthCSS2(),
-                getBorderRightWidthCSS2(),
-                getBorderLeftWidthCSS2());
-    }
-
-    public final CssBorderWidthCSS1 getBorderWidthCSS1() {
-        // WARNING invalid fields in this property ....
-        return new CssBorderWidthCSS1(getBorderTopWidthCSS1(),
-                getBorderBottomWidthCSS1(),
-                getBorderRightWidthCSS1(),
-                getBorderLeftWidthCSS1());
-    }
-
-    /**
-     * Get the border-style property
-     */
-    public final CssBorderStyle getBorderStyle() {
-        // WARNING invalid fields in this property ....
-        return new CssBorderStyle(getBorderTopStyle(),
-                getBorderBottomStyle(),
-                getBorderRightStyle(),
-                getBorderLeftStyle());
-    }
-
-    public final CssBorderStyleCSS2 getBorderStyleCSS2() {
-        // WARNING invalid fields in this property ....
-        return new CssBorderStyleCSS2(getBorderTopStyleCSS2(),
-                getBorderBottomStyleCSS2(),
-                getBorderRightStyleCSS2(),
-                getBorderLeftStyleCSS2());
-    }
-
-    public final CssBorderStyleCSS1 getBorderStyleCSS1() {
-        // WARNING invalid fields in this property ....
-        return new CssBorderStyleCSS1(getBorderTopStyleCSS1(),
-                getBorderBottomStyleCSS1(),
-                getBorderRightStyleCSS1(),
-                getBorderLeftStyleCSS1());
-    }
-
-    /**
-     * Get the border-color property
-     */
-    public final CssBorderColor getBorderColor() {
-        // WARNING invalid fields in this porperty ....
-        return new CssBorderColor(getBorderTopColor(),
-                getBorderBottomColor(),
-                getBorderRightColor(),
-                getBorderLeftColor());
-    }
-
-    public final CssBorderColorCSS2 getBorderColorCSS2() {
-        // WARNING invalid fields in this porperty ....
-        return new CssBorderColorCSS2(getBorderTopColorCSS2(),
-                getBorderBottomColorCSS2(),
-                getBorderRightColorCSS2(),
-                getBorderLeftColorCSS2());
-    }
-
-    public final CssBorderColorCSS1 getBorderColorCSS1() {
-        // WARNING invalid fields in this porperty ....
-        return new CssBorderColorCSS1(getBorderTopColorCSS1(),
-                getBorderBottomColorCSS1(),
-                getBorderRightColorCSS1(),
-                getBorderLeftColorCSS1());
-    }
 
     /**
      * Get the width property
@@ -2340,9 +1763,6 @@
      */
     public void findConflicts(ApplContext ac, Warnings warnings,
                               CssSelectors selector, CssSelectors[] allSelectors) {
-        // if border-style == none, border-width should be 0
-        // @@ this is a horrible place to do this ...
-        cssBorder.check();
 
         // check conflicts for 'font-family'
         findConflictsFontFamily(ac, warnings, selector, allSelectors);
@@ -2355,26 +1775,26 @@
         }
 
         if (cssBackground.getColor() != null) {
-            org.w3c.css.properties.css.CssColor colorCSS3 = cssColor;
+            org.w3c.css.properties.css.CssColor fgColor = cssColor;
             // we need to look if there is the same selector elsewhere
             // containing a color definition
             for (int i = 0; i < allSelectors.length; i++) {
                 CssSelectors sel = allSelectors[i];
                 if (sel.toString().equals(selector.toString())) {
-                    colorCSS3 = ((Css1Style) sel.getStyle()).cssColor;
+                    fgColor = ((Css1Style) sel.getStyle()).cssColor;
                     break;
                 }
             }
-            if (colorCSS3 != null) {
-                if (cssBackground.getColor().equals(colorCSS3.getColor())) {
+            if (fgColor != null) {
+                if (cssBackground.getColor().equals(fgColor.getColor())) {
                     // background and color can't have the same color
                     warnings.addWarning(new Warning(cssBackground.color,
-                            "same-colors", 1, colorCSS3, ac));
+                            "same-colors", 1, fgColor, ac));
                 } else if (cssBackground.getColor().equals(
                         CssProperty.transparent)) {
 //		  It's better to have a background color with a color
                     warnings.addWarning(new Warning(
-                            colorCSS3, "no-background-color", 2, emptyArray, ac));
+                            fgColor, "no-background-color", 2, emptyArray, ac));
                 }
             } else {
                 CssValue color = cssBackground.getColor();
@@ -2388,45 +1808,55 @@
 
             // Note : For borders, I don't look for inherited value.
             //        So I can't find same colors in two differents contexts.
-
-            if (cssBorder.getTop().getColor() != null) {
-                CssValue color = cssBorder.getTop().getColor();
+            if (cssBorder.borderColor.shorthand) {
+                CssValue color = (CssValue) cssBorder.borderColor.top.get();
                 if (color != CssProperty.inherit
                         && cssBackground.getColor().equals(color)) {
                     // background and border-color can't have the same color
                     warnings.addWarning(new Warning(cssBackground.color,
                             "same-colors", 1,
-                            cssBorder.getTop().color, ac));
+                            cssBorder.borderColor, ac));
                 }
-            }
-            if (cssBorder.getRight().getColor() != null) {
-                CssValue color = cssBorder.getRight().getColor();
-                if (color != CssProperty.inherit
-                        && cssBackground.getColor().equals(color)) {
-                    // background and border-color can't have the same color
-                    warnings.addWarning(new Warning(cssBackground.color,
-                            "same-colors", 1,
-                            cssBorder.getRight().color, ac));
+            } else {
+                if (cssBorder.borderColor.top != null) {
+                    CssValue color = (CssValue) cssBorder.borderColor.top.get();
+                    if (color != CssProperty.inherit
+                            && cssBackground.getColor().equals(color)) {
+                        // background and border-color can't have the same color
+                        warnings.addWarning(new Warning(cssBackground.color,
+                                "same-colors", 1,
+                                cssBorder.borderColor.top, ac));
+                    }
                 }
-            }
-            if (cssBorder.getBottom().getColor() != null) {
-                CssValue color = cssBorder.getBottom().getColor();
-                if (color != CssProperty.inherit
-                        && cssBackground.getColor().equals(color)) {
-                    // background and border-color can't have the same color
-                    warnings.addWarning(new Warning(cssBackground.color,
-                            "same-colors", 1,
-                            cssBorder.getBottom().color, ac));
+                if (cssBorder.borderColor.right != null) {
+                    CssValue color = (CssValue) cssBorder.borderColor.right.get();
+                    if (color != CssProperty.inherit
+                            && cssBackground.getColor().equals(color)) {
+                        // background and border-color can't have the same color
+                        warnings.addWarning(new Warning(cssBackground.color,
+                                "same-colors", 1,
+                                cssBorder.borderColor.right, ac));
+                    }
                 }
-            }
-            if (cssBorder.getLeft().getColor() != null) {
-                CssValue color = cssBorder.getLeft().getColor();
-                if (color != CssProperty.inherit
-                        && cssBackground.getColor().equals(color)) {
-                    // background and border-color can't have the same color
-                    warnings.addWarning(new Warning(cssBackground.color,
-                            "same-colors", 1,
-                            cssBorder.getLeft().color, ac));
+                if (cssBorder.borderColor.bottom != null) {
+                    CssValue color = (CssValue) cssBorder.borderColor.bottom.get();
+                    if (color != CssProperty.inherit
+                            && cssBackground.getColor().equals(color)) {
+                        // background and border-color can't have the same color
+                        warnings.addWarning(new Warning(cssBackground.color,
+                                "same-colors", 1,
+                                cssBorder.borderColor.bottom, ac));
+                    }
+                }
+                if (cssBorder.borderColor.left != null) {
+                    CssValue color = (CssValue) cssBorder.borderColor.left.get();
+                    if (color != CssProperty.inherit
+                            && cssBackground.getColor().equals(color)) {
+                        // background and border-color can't have the same color
+                        warnings.addWarning(new Warning(cssBackground.color,
+                                "same-colors", 1,
+                                cssBorder.borderColor.left, ac));
+                    }
                 }
             }
             /* suppressed 03-09-98

--- CssBorderTopCSS2.java DELETED ---

--- CssBorderWidthCSS2.java DELETED ---

--- CssBorderBottomCSS2.java DELETED ---

Index: CssBorderRight.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderRight.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CssBorderRight.java	9 Sep 2011 12:16:44 -0000	1.5
+++ CssBorderRight.java	25 Apr 2012 20:21:58 -0000	1.6
@@ -1,354 +1,96 @@
-//
 // $Id$
 // From Philippe Le Hegaret (http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#value-def-border-width
  * @version $Revision$
  */
-public class CssBorderRightWidth extends CssProperty {
-
-    CssBorderFaceWidth face;
+public class CssBorderRightWidth extends org.w3c.css.properties.css.CssBorderRightWidth {
 
     /**
      * Create a new CssBorderRightWidth
      */
     public CssBorderRightWidth() {
-	face = new CssBorderFaceWidth();
     }
 
     /**
-     * Create a new CssBorderRightWidth with an another CssBorderFaceWidth
-     *
-     * @param another The another side.
-     */
-    public CssBorderRightWidth(CssBorderFaceWidth another) {
-	setByUser();
-
-	face = another;
-    }
-
-    /**
-     * Create a new CssBorderRightWidth
+     * Creates a new CssBorderRightWidth
      *
-     * @param expression The expression for this property.
-     * @exception InvalidParamException Values are incorrect
+     * @param expression The expression for this property
+     * @throws org.w3c.css.util.InvalidParamException
+     *          Expressions are incorrect
      */
-    public CssBorderRightWidth(ApplContext ac, CssExpression expression,
-	    boolean check) throws InvalidParamException {
-
-	if(check && expression.getCount() > 1) {
-	    throw new InvalidParamException("unrecognize", ac);
-	}
-
-	setByUser();
-
-	face = new CssBorderFaceWidth(ac, expression);
+    public CssBorderRightWidth(ApplContext ac, CssExpression expression, boolean check)
+            throws InvalidParamException {
+        setByUser();
+        // here we delegate to BorderWidth implementation
+        value = CssBorderWidth.checkBorderSideWidth(ac, this, expression, check);
     }
 
     public CssBorderRightWidth(ApplContext ac, CssExpression expression)
-	throws InvalidParamException {
-	this(ac, expression,false);
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return face;
-    }
-
-    /**
-     * Return the value of this property
-     */
-    public CssValue getValue() {
-	if(face != null) {
-	    return face.getValue();
-	}
-	return null;
-    }
-
-    /**
-     * Returns a string representation of the object.
-     */
-    public String toString() {
-	if(face != null) {
-	    return face.toString();
-	}
-	return "";
-    }
-
-    /**
-     * Returns the name of this property
-     */
-    public String getPropertyName() {
-	return "border-right-width";
-    }
-
-    /**
-     * Add this property to the CssStyle.
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	CssBorderRight right = ((Css1Style) style).cssBorder.right;
-	if (right.width != null)
-	    style.addRedefinitionWarning(ac, this);
-	right.width = this;
-    }
-
-    /**
-     * Get this property in the style.
-     *
-     * @param style The style where the property is
-     * @param resolve if true, resolve the style to find this property
-     */
-    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
-	if (resolve) {
-	    return ((Css1Style) style).getBorderRightWidth();
-	} else {
-	    return ((Css1Style) style).cssBorder.getRight().width;
-	}
-    }
-
-    /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
-     */
-    public boolean equals(CssProperty property) {
-	return (property instanceof CssBorderRightWidth &&
-		face.equals(((CssBorderRightWidth) property).face));
+            throws InvalidParamException {
+        this(ac, expression, false);
     }
 
 }
+

Index: CssBorderWidth.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderWidth.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CssBorderWidth.java	9 Sep 2011 12:16:44 -0000	1.5
+++ CssBorderWidth.java	25 Apr 2012 20:22:00 -0000	1.6
@@ -1,318 +1,200 @@
-//
 // $Id$
-// From Philippe Le Hegaret (http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#value-def-border-width
+ */
+public class CssBorderWidth extends org.w3c.css.properties.css.CssBorderWidth {
 
-	setByUser();
-	switch (expression.getCount()) {
-	case 1:
-	    top = new CssBorderTopWidth(ac, expression);
-	    bottom = new CssBorderBottomWidth((CssBorderFaceWidth) top.get());
-	    right = new CssBorderRightWidth((CssBorderFaceWidth) top.get());
-	    left = new CssBorderLeftWidth((CssBorderFaceWidth) top.get());
-	    break;
-	case 2:
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-			((new Character(expression.getOperator())).toString()),
-			ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    top = new CssBorderTopWidth(ac, expression);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    right = new CssBorderRightWidth(ac, expression);
-	    bottom = new CssBorderBottomWidth((CssBorderFaceWidth) top.get());
-	    left = new CssBorderLeftWidth((CssBorderFaceWidth) right.get());
-	    break;
-	case 3:
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-			((new Character(expression.getOperator())).toString()),
-			ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    top = new CssBorderTopWidth(ac, expression);
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-			((new Character(expression.getOperator())).toString()),
-			ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    right = new CssBorderRightWidth(ac, expression);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    bottom = new CssBorderBottomWidth(ac, expression);
-	    left = new CssBorderLeftWidth((CssBorderFaceWidth) right.get());
-	    break;
-	default:
-	    // checks the number of parameters
-	    if(check && expression.getCount() > 4) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-			((new Character(expression.getOperator())).toString()),
-			ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    top = new CssBorderTopWidth(ac, expression);
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-			((new Character(expression.getOperator())).toString()),
-			ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    right = new CssBorderRightWidth(ac, expression);
-	    if (expression.getOperator() != SPACE)
-		throw new InvalidParamException("operator",
-			((new Character(expression.getOperator())).toString()),
-			ac);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    bottom = new CssBorderBottomWidth(ac, expression);
-	    if(expression.getValue().equals(inherit)) {
-		throw new InvalidParamException("unrecognize", ac);
-	    }
-	    left = new CssBorderLeftWidth(ac, expression);
-	    break;
-	}
-    }
+    public static CssIdent allowed_values[];
 
-    public CssBorderWidth(ApplContext ac, CssExpression expression)
-	throws InvalidParamException {
-	this(ac, expression, false);
+    static {
+        allowed_values = new CssIdent[3];
+        allowed_values[0] = CssIdent.getIdent("thin");
+        allowed_values[1] = CssIdent.getIdent("medium");
+        allowed_values[2] = CssIdent.getIdent("thick");
     }
 
-    /**
-     * Returns the value of this property
+    /*
+     * Get the cached ident if it matches null otherwise
      */
-    public Object get() {
-	return top;
+    static CssIdent getMatchingIdent(CssIdent ident) {
+        for (CssIdent id : allowed_values) {
+            if (id.equals(ident)) {
+                return id;
+            }
+        }
+        return null;
     }
 
     /**
-     * Returns the name of this property
+     * Create a new CssBorderWidth
      */
-    public String getPropertyName() {
-	return "border-width";
+    public CssBorderWidth() {
     }
 
     /**
-     * Returns a string representation of the object.
+     * Set the value of the property<br/>
+     * Does not check the number of values
+     *
+     * @param expression The expression for this property
+     * @throws org.w3c.css.util.InvalidParamException
+     *          The expression is incorrect
      */
-    public String toString() {
-	if (right.face.equals(left.face)) {
-	    if (top.face.equals(bottom.face)) {
-		if (top.face.equals(right.face)) {
-		    return top.toString();
-		} else {
-		    return top + " " + right;
-		}
-	    } else {
-		return top + " " + right + " " + bottom;
-	    }
-	} else {
-	    return top + " " + right + " " + bottom + " " + left;
-	}
+    public CssBorderWidth(ApplContext ac, CssExpression expression)
+            throws InvalidParamException {
+        this(ac, expression, false);
     }
 
     /**
-     * Set this property to be important.
-     * Overrides this method for a macro
+     * Set the value of the property
+     *
+     * @param expression The expression for this property
+     * @param check      set it to true to check the number of values
+     * @throws org.w3c.css.util.InvalidParamException
+     *          The expression is incorrect
      */
-    public void setImportant() {
-	top.important = true;
-	right.important = true;
-	left.important = true;
-	bottom.important = true;
-    }
+    public CssBorderWidth(ApplContext ac, CssExpression expression,
+                          boolean check) throws InvalidParamException {
+        if (check && expression.getCount() > 4) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        setByUser();
+        CssValue val;
+        char op;
 
-    /**
-     * Returns true if this property is important.
-     * Overrides this method for a macro
-     */
-    public boolean getImportant() {
-	return ((top == null || top.important) &&
-		(right == null || right.important) &&
-		(left == null || left.important) &&
-		(bottom == null || bottom.important));
-    }
+        ArrayList<CssValue> res = new ArrayList<CssValue>();
+        while (res.size() < 4 && !expression.end()) {
+            val = expression.getValue();
+            op = expression.getOperator();
 
-    /**
-     * Set the context.
-     * Overrides this method for a macro
-     *
-     * @see org.w3c.css.css.CssCascadingOrder#order
-     * @see org.w3c.css.css.StyleSheetParser#handleRule
-     */
-    public void setSelectors(CssSelectors selector) {
-	super.setSelectors(selector);
-	if (top != null) {
-	    top.setSelectors(selector);
-	}
-	if (right != null) {
-	    right.setSelectors(selector);
-	}
-	if (bottom != null) {
-	    bottom.setSelectors(selector);
-	}
-	if (left != null) {
-	    left.setSelectors(selector);
-	}
-    }
+            switch (val.getType()) {
+                case CssTypes.CSS_NUMBER:
+                    val = ((CssNumber) val).getLength();
+                case CssTypes.CSS_LENGTH:
+                    CssLength length = (CssLength) val;
+                    if (!length.isPositive()) {
+                        throw new InvalidParamException("negative-value", expression.getValue(),
+                                getPropertyName(), ac);
+                    }
+                    res.add(length);
+                    break;
+                case CssTypes.CSS_IDENT:
+                    if (inherit.equals(val)) {
+                        res.add(inherit);
+                        break;
+                    }
+                    CssIdent match = getMatchingIdent((CssIdent) val);
+                    if (match == null) {
+                        throw new InvalidParamException("value", expression.getValue(),
+                                getPropertyName(), ac);
+                    }
+                    res.add(match);
+                    break;
+                default:
+                    throw new InvalidParamException("unrecognize", ac);
+            }
+            expression.next();
+            if (op != SPACE) {
+                throw new InvalidParamException("operator",
+                        Character.toString(op),
+                        ac);
+            }
+        }
+        // check that inherit is alone
+        if (res.size() > 1 && res.contains(inherit)) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        value = (res.size() == 1) ? res.get(0) : new CssValueList(res);
 
-    /**
-     * Add this property to the CssStyle
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	if(top != null) {
-	    top.addToStyle(ac, style);
-	}
-	if(right != null) {
-	    right.addToStyle(ac, style);
-	}
-	if(left != null) {
-	    left.addToStyle(ac, style);
-	}
-	if(bottom != null) {
-	    bottom.addToStyle(ac, style);
-	}
-    }
+        // now assign the computed values...
+        top = new CssBorderTopWidth();
+        right = new CssBorderRightWidth();
+        bottom = new CssBorderBottomWidth();
+        left = new CssBorderLeftWidth();
 
-    /**
-     * Get this property in the style.
-     *
-     * @param style The style where the property is
-     * @param resolve if true, resolve the style to find this property
-     */
-    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
-	throw new IllegalStateException("Can't invoke this method on the property " +
-					getPropertyName());
+        switch (res.size()) {
+            case 1:
+                top.value = left.value = right.value = bottom.value = res.get(0);
+                break;
+            case 2:
+                top.value = bottom.value = res.get(0);
+                right.value = left.value = res.get(1);
+                break;
+            case 3:
+                top.value = res.get(0);
+                right.value = left.value = res.get(1);
+                bottom.value = res.get(2);
+                break;
+            case 4:
+                top.value = res.get(0);
+                right.value = res.get(1);
+                bottom.value = res.get(2);
+                left.value = res.get(3);
+                break;
+            default:
+                // can't happen
+                throw new InvalidParamException("unrecognize", ac);
+        }
     }
 
-    /**
-     * Update the source file and the line.
-     * Overrides this method for a macro
-     *
-     * @param line The line number where this property is defined
-     * @param source The source file where this property is defined
-     */
-    public void setInfo(int line, String source) {
-	super.setInfo(line, source);
-	if(top != null) {
-	    top.setInfo(line, source);
-	}
-	if(right != null) {
-	    right.setInfo(line, source);
-	}
-	if(left != null) {
-	    left.setInfo(line, source);
-	}
-	if(bottom != null) {
-	    bottom.setInfo(line, source);
-	}
-    }
 
     /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
+     * Check the border-*-width and returns a value.
+     * It makes sense to do it only once for all the sides, so by having the code here.
      */
-    public boolean equals(CssProperty property) {
-	return false; //FIXME
+    protected static CssValue checkBorderSideWidth(ApplContext ac, CssProperty caller, CssExpression expression,
+                                                   boolean check) throws InvalidParamException {
+        if (check && expression.getCount() > 1) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        CssValue retval = null;
+        CssValue val = expression.getValue();
+        switch (val.getType()) {
+            case CssTypes.CSS_NUMBER:
+                val = ((CssNumber) val).getLength();
+            case CssTypes.CSS_LENGTH:
+                CssLength length = (CssLength) val;
+                if (!length.isPositive()) {
+                    throw new InvalidParamException("negative-value", expression.getValue(),
+                            caller.getPropertyName(), ac);
+                }
+                retval = length;
+                break;
+            case CssTypes.CSS_IDENT:
+                if (inherit.equals(val)) {
+                    retval = inherit;
+                } else {
+                    retval = getMatchingIdent((CssIdent) val);
+                }
+                if (retval == null) {
+                    throw new InvalidParamException("value", expression.getValue(),
+                            caller.getPropertyName(), ac);
+                }
+                break;
+            default:
+                throw new InvalidParamException("unrecognize", ac);
+        }
+        expression.next();
+        return retval;
     }
-
 }

--- CssBorderRightWidthCSS1.java DELETED ---

--- CssBorderLeftColorCSS2.java DELETED ---

--- CssBorderLeftColor.java DELETED ---

--- CssBorderRightStyleCSS2.java DELETED ---

--- CssBorderFaceColorCSS1.java DELETED ---

--- CssBorderRightWidthCSS2.java DELETED ---

Index: CssBorderTop.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderTop.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CssBorderTop.java	9 Sep 2011 12:16:44 -0000	1.5
+++ CssBorderTop.java	25 Apr 2012 20:21:59 -0000	1.6
@@ -1,357 +1,96 @@
-//
 // $Id$
 // From Philippe Le Hegaret (
Received on Wednesday, 25 April 2012 20:22:41 UTC

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