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

2002/css-validator/org/w3c/css/properties/css3 CssBorder.java,NONE,1.1 CssBorderBottom.java,NONE,1.1 CssBorderBottomColor.java,NONE,1.1 CssBorderBottomStyle.java,NONE,1.1 CssBorderBottomWidth.java,NONE,1.1 CssBorderColor.java,NONE,1.1 CssBorderImageOutset.java,NONE,1.1 CssBorderImageRepeat.java,NONE,1.1 CssBorderImageSlice.java,NONE,1.1 CssBorderImageSource.java,NONE,1.1 CssBorderImageWidth.java,NONE,1.1 CssBorderLeft.java,NONE,1.1 CssBorderLeftColor.java,NONE,1.1 CssBorderLeftStyle.java,NONE,1.1 CssBorderLeftWidth.java,NONE,1.1 CssBorderRight.java,NONE,1.1 CssBorderRightColor.java,NONE,1.1 CssBorderRightStyle.java,NONE,1.1 CssBorderRightWidth.java,NONE,1.1 CssBorderStyle.java,NONE,1.1 CssBorderTop.java,NONE,1.1 CssBorderTopColor.java,NONE,1.1 CssBorderTopStyle.java,NONE,1.1 CssBorderTopWidth.java,NONE,1.1 CssBorderWidth.java,NONE,1.1 Css3Style.java,1.18,1.19 CssBackgroundPosition.java,1.1,1.2 CssBorderBottomLeftRadius.java,1.4,1.5 CssBorderBottomRightRadius.java,1.4,1.5 CssBorderImage.java,1.3,1.4

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

Modified Files:
	Css3Style.java CssBackgroundPosition.java 
	CssBorderBottomLeftRadius.java CssBorderBottomRightRadius.java 
	CssBorderImage.java CssBorderRadius.java 
	CssBorderTopLeftRadius.java CssBorderTopRightRadius.java 
	CssColor.java CssColumnRuleStyle.java CssColumnRuleWidth.java 
Added Files:
	CssBorder.java CssBorderBottom.java CssBorderBottomColor.java 
	CssBorderBottomStyle.java CssBorderBottomWidth.java 
	CssBorderColor.java CssBorderImageOutset.java 
	CssBorderImageRepeat.java CssBorderImageSlice.java 
	CssBorderImageSource.java CssBorderImageWidth.java 
	CssBorderLeft.java CssBorderLeftColor.java 
	CssBorderLeftStyle.java CssBorderLeftWidth.java 
	CssBorderRight.java CssBorderRightColor.java 
	CssBorderRightStyle.java CssBorderRightWidth.java 
	CssBorderStyle.java CssBorderTop.java CssBorderTopColor.java 
	CssBorderTopStyle.java CssBorderTopWidth.java 
	CssBorderWidth.java 
Removed Files:
	CssBorderBottomFitLength.java CssBorderBottomFitWidth.java 
	CssBorderBottomImage.java CssBorderBottomLeftFitLength.java 
	CssBorderBottomLeftFitWidth.java CssBorderBottomLeftImage.java 
	CssBorderBottomRightFitLength.java 
	CssBorderBottomRightFitWidth.java 
	CssBorderBottomRightImage.java CssBorderBreak.java 
	CssBorderCornerFit.java CssBorderCornerImage.java 
	CssBorderFit.java CssBorderFitLength.java 
	CssBorderFitWidth.java CssBorderImageTransform.java 
	CssBorderLeftFitLength.java CssBorderLeftFitWidth.java 
	CssBorderLeftImage.java CssBorderRightFitLength.java 
	CssBorderRightFitWidth.java CssBorderRightImage.java 
	CssBorderTopFitLength.java CssBorderTopFitWidth.java 
	CssBorderTopImage.java CssBorderTopLeftFitLength.java 
	CssBorderTopLeftFitWidth.java CssBorderTopLeftImage.java 
	CssBorderTopRightFitLength.java CssBorderTopRightFitWidth.java 
	CssBorderTopRightImage.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 



--- CssBorderLeftImage.java DELETED ---

--- CssBorderBottomLeftImage.java DELETED ---

--- CssBorderTopLeftFitLength.java DELETED ---

--- NEW FILE: CssBorderBottomWidth.java ---
// $Id: CssBorderBottomWidth.java,v 1.1 2012/04/25 20:22:04 ylafon Exp $
// Author: Yves Lafon <http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#value-def-border-width
 * @version $Revision: 1.1 $
 */
public class CssBorderBottomWidth extends org.w3c.css.properties.css.CssBorderBottomWidth {

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

    /**
     * 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);
    }

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

}


--- NEW FILE: CssBorderStyle.java ---
// $Id: CssBorderStyle.java,v 1.1 2012/04/25 20:22:06 ylafon Exp $
// @author Yves Lafon <http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#value-def-border-style
 */
public class CssBorderStyle extends org.w3c.css.properties.css.CssBorderStyle {

    public static CssIdent allowed_values[];

    static {
        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);

        }
    }

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

    /**
     * Create a new CssBorderStyle
     */
    public CssBorderStyle() {
        value = initial;
        top = new CssBorderTopStyle();
        right = new CssBorderRightStyle();
        bottom = new CssBorderBottomStyle();
        left = new CssBorderLeftStyle();
    }

    /**
     * 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 CssBorderStyle(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * 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 CssBorderStyle(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
        if (check && expression.getCount() > 4) {
            throw new InvalidParamException("unrecognize", ac);
        }
        setByUser();
        CssValue val;
        char op;

        ArrayList<CssValue> res = new ArrayList<CssValue>();
        while (res.size() < 4 && !expression.end()) {
            val = expression.getValue();
            op = expression.getOperator();

            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);

        // 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);
        }
        shorthand = true;
    }

    /**
     * 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.
     */
    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;
    }

}

--- NEW FILE: CssBorderImageSlice.java ---
// $Id: CssBorderImageSlice.java,v 1.1 2012/04/25 20:22:05 ylafon Exp $
// Author: Yves Lafon <http://www.w3.org/TR/2012/CR-css3-background-20120417/#the-border-image-slice
 */
public class CssBorderImageSlice extends org.w3c.css.properties.css.CssBorderImageSlice {

    public static final CssIdent fill;

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

    public final static CssIdent getMatchingIdent(CssIdent ident) {
        return (fill.equals(ident)) ? fill : null;
    }

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

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

        CssValueList valueList = new CssValueList();
        if (check && expression.getCount() > 5) {
            throw new InvalidParamException("unrecognize", ac);
        }
        CssValue val;
        char op;
        boolean gotFill = false;

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

            switch (val.getType()) {
                case CssTypes.CSS_NUMBER:
                    CssNumber num = (CssNumber)val;
                    if (!num.isPositive()) {
                        throw new InvalidParamException("negative-value", expression.getValue(),
                                getPropertyName(), ac);
                    }
                    valueList.add(val);
                    break;
                case CssTypes.CSS_PERCENTAGE:
                    CssPercentage percent = (CssPercentage) val;
                    if (!percent.isPositive()) {
                        throw new InvalidParamException("negative-value", expression.getValue(),
                                getPropertyName(), ac);
                    }
                    if (percent.floatValue() > 100f) {
                        ac.getFrame().addWarning("out-of-range", percent.toString());
                    }
                    valueList.add(val);
                    break;
                case CssTypes.CSS_IDENT:
                    if (inherit.equals(val)) {
                        if (expression.getCount() > 1) {
                            throw new InvalidParamException("unrecognize", ac);
                        }
                        valueList.add(inherit);
                        break;
                    }
                    if (fill.equals(val)) {
                        // fill is first or last and can't appear twice
                        if (gotFill || (valueList.size() != 0 && expression.getRemainingCount() > 1)) {
                            throw new InvalidParamException("value", val.toString(),
                                    getPropertyName(), ac);
                        }
                        gotFill = true;
                        break;
                    }
                    // unrecognized ident, let it fail
                default:
                    throw new InvalidParamException("value", val.toString(),
                            getPropertyName(), ac);
            }
            expression.next();
            if (op != SPACE) {
                throw new InvalidParamException("operator",
                        Character.toString(op),
                        ac);
            }
        }
        // we add fill last to normalize
        if (gotFill) {
            valueList.add(fill);
        }
        value = (valueList.size() == 1) ? valueList.get(0) : valueList;
    }

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


Index: CssBorderImage.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBorderImage.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssBorderImage.java	5 Jan 2010 13:49:50 -0000	1.3
+++ CssBorderImage.java	25 Apr 2012 20:22:05 -0000	1.4
@@ -1,154 +1,452 @@
-//
 // $Id$
-// From Sijtsche de Jong (http://www.w3.org/Consortium/Legal/copyright-software-19980720
 
 package org.w3c.css.properties.css3;
 
-import org.w3c.css.parser.CssStyle;
-import org.w3c.css.properties.css.CssProperty;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
 import org.w3c.css.values.CssIdent;
-import org.w3c.css.values.CssNumber;
-import org.w3c.css.values.CssURL;
+import org.w3c.css.values.CssTypes;
 import org.w3c.css.values.CssValue;
 
+import static org.w3c.css.values.CssOperator.SPACE;
 
 
-public class CssBorderImage extends CssProperty {
+public class CssBorderImage extends org.w3c.css.properties.css.CssBorderImage {
 
-    String value = "";
-    ApplContext ac;
-    CssIdent none = new CssIdent("none");
 
     /**
      * Create new CssBorderImage
      */
     public CssBorderImage() {
-	value = "none";
+        value = initial;
     }
 
     /**
      * Create new CssBorderImage
      *
      * @param expression The expression for this property
-     * @exception InvalidParamException Values are incorrect
+     * @throws InvalidParamException Values are incorrect
      */
     public CssBorderImage(ApplContext ac, CssExpression expression,
-	    boolean check) throws InvalidParamException {
-	setByUser();
-	CssValue val = null;
+                          boolean check) throws InvalidParamException {
+        int state = 0;
+        // <?border-image-source?> || <?border-image-slice?> [ / <?border-image-width?> | / <?border-image-width?>? / <?border-image-outset?> ]? || <?border-image-repeat?>
 
-	if (!(expression.getCount() <= 4)) {
-	    throw new InvalidParamException("value", expression.getValue(),
-		    getPropertyName(), ac);
-	}
+        // state 0, we check for <?border-image-source?> || <?border-image-slice?> || <?border-image-repeat?>
+        // state 1, we check only <?border-image-width?> ( first / after <?border-image-slice?>)
+        // state 2, we check only for  <?border-image-outset?>
+        CssExpression newexp;
+        CssValue val, tval;
+        char op;
 
-	for (int i=0; i < expression.getCount(); i++) {
+        while (!expression.end()) {
+            val = expression.getValue();
+            op = expression.getOperator();
 
-	    val = expression.getValue();
+            switch (val.getType()) {
+                case CssTypes.CSS_URL:
+                    if (source != null) {
+                        throw new InvalidParamException("unrecognize", ac);
+                    }
+                    // newexp = new CssExpression();
+                    // newexp.addValue(val);
+                    // work on this expression as it consumes only one token
+                    source = new CssBorderImageSource(ac, expression, false);
+                    // we must reset the operator
+                    state = 0;
+                    op = expression.getOperator();
+                    break;
+                case CssTypes.CSS_SWITCH:
+                    state++;
+                    if (state > 2) {
+                        throw new InvalidParamException("value", val.toString(),
+                                getPropertyName(), ac);
+                    }
+                    expression.next();
+                    break;
+                case CssTypes.CSS_IDENT:
+                    if (inherit.equals(val)) {
+                        if (expression.getCount() > 1) {
+                            throw new InvalidParamException("unrecognize", ac);
+                        }
+                        value = inherit;
+                        // TODO force individual values as inherit
+                        expression.next();
+                        break;
+                    }
+                    switch (state) {
+                        case 0:
+                            // state 0, we can only have slice or repeat
+                            // slice
+                            tval = CssBorderImageSlice.getMatchingIdent((CssIdent) val);
+                            if (tval != null) {
+                                if (slice != null) {
+                                    throw new InvalidParamException("value", val.toString(),
+                                            getPropertyName(), ac);
+                                }
+                                newexp = getSliceExpression(ac, expression);
+                                if (newexp != null) {
+                                    slice = new CssBorderImageSlice(ac, newexp, check);
+                                    break;
+                                }
+                                throw new InvalidParamException("value", val.toString(),
+                                        getPropertyName(), ac);
+                            }
+                            // repeat
+                            newexp = getRepeatExpression(ac, expression);
+                            if (newexp != null) {
+                                if (repeat != null) {
+                                    throw new InvalidParamException("value", val.toString(),
+                                            getPropertyName(), ac);
+                                }
+                                repeat = new CssBorderImageRepeat(ac, newexp, check);
+                                break;
+                            }
+                            // TODO check for border-image! (none)
+                            if (CssBorderImageSource.isMatchingIdent((CssIdent) val)) {
+                                if (source != null) {
+                                    throw new InvalidParamException("value", val.toString(),
+                                            getPropertyName(), ac);
+                                }
+                                source = new CssBorderImageSource(ac, expression, false);
+                                break;
+                            }
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                        case 1:
+                            // it can be only width or repeat.
+                            // width
+                            tval = CssBorderImageWidth.getMatchingIdent((CssIdent) val);
+                            if (tval != null) {
+                                if (width != null) {
+                                    throw new InvalidParamException("value", val.toString(),
+                                            getPropertyName(), ac);
+                                }
+                                newexp = getWidthExpression(ac, expression);
+                                if (newexp != null) {
+                                    width = new CssBorderImageWidth(ac, newexp, check);
+                                    break;
+                                }
+                                throw new InvalidParamException("value", val.toString(),
+                                        getPropertyName(), ac);
+                            }
+                        case 2:
+                            // outset has no ident so let 1 and 2 check repeat
+                            newexp = getRepeatExpression(ac, expression);
+                            if (newexp != null) {
+                                if (repeat != null) {
+                                    throw new InvalidParamException("value", val.toString(),
+                                            getPropertyName(), ac);
+                                }
+                                repeat = new CssBorderImageRepeat(ac, newexp, check);
+                                state = 0;
+                                break;
+                            }
+                            // TODO check for border-image! (none)
+                            if (CssBorderImageSource.isMatchingIdent((CssIdent) val)) {
+                                if (source != null) {
+                                    throw new InvalidParamException("value", val.toString(),
+                                            getPropertyName(), ac);
+                                }
+                                source = new CssBorderImageSource(ac, expression, false);
+                                state = 0;
+                                break;
+                            }
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                    }
+                    break;
+                case CssTypes.CSS_PERCENTAGE:
+                    // can appear only in slice and width (so 0 and 1)
+                    switch (state) {
+                        case 0:
+                            if (slice != null) {
+                                throw new InvalidParamException("value", val.toString(),
+                                        getPropertyName(), ac);
+                            }
+                            newexp = getSliceExpression(ac, expression);
+                            if (newexp != null) {
+                                slice = new CssBorderImageSlice(ac, newexp, check);
+                                break;
+                            }
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                        case 1:
+                            if (width != null) {
+                                throw new InvalidParamException("value", val.toString(),
+                                        getPropertyName(), ac);
+                            }
+                            newexp = getWidthExpression(ac, expression);
+                            if (newexp != null) {
+                                width = new CssBorderImageWidth(ac, newexp, check);
+                                break;
+                            }
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                        case 2:
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                    }
+                    break;
+                case CssTypes.CSS_LENGTH:
+                    // can appear only in width and outset (so 1 and 2)
+                    switch (state) {
+                        case 0:
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                        case 1:
+                            if (width != null) {
+                                throw new InvalidParamException("value", val.toString(),
+                                        getPropertyName(), ac);
+                            }
+                            newexp = getWidthExpression(ac, expression);
+                            if (newexp != null) {
+                                width = new CssBorderImageWidth(ac, newexp, check);
+                                break;
+                            }
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                        case 2:
+                            if (outset != null) {
+                                throw new InvalidParamException("value", val.toString(),
+                                        getPropertyName(), ac);
+                            }
+                            newexp = getOutsetExpression(ac, expression);
+                            if (newexp != null) {
+                                outset = new CssBorderImageOutset(ac, newexp, check);
+                                break;
+                            }
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                    }
+                    break;
+                case CssTypes.CSS_NUMBER:
+                    switch (state) {
+                        case 0:
+                            if (slice != null) {
+                                throw new InvalidParamException("value", val.toString(),
+                                        getPropertyName(), ac);
+                            }
+                            newexp = getSliceExpression(ac, expression);
+                            if (newexp != null) {
+                                slice = new CssBorderImageSlice(ac, newexp, check);
+                                break;
+                            }
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                        case 1:
+                            if (width != null) {
+                                throw new InvalidParamException("value", val.toString(),
+                                        getPropertyName(), ac);
+                            }
+                            newexp = getWidthExpression(ac, expression);
+                            if (newexp != null) {
+                                width = new CssBorderImageWidth(ac, newexp, check);
+                                break;
+                            }
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                        case 2:
+                            if (outset != null) {
+                                throw new InvalidParamException("value", val.toString(),
+                                        getPropertyName(), ac);
+                            }
+                            newexp = getOutsetExpression(ac, expression);
+                            if (newexp != null) {
+                                outset = new CssBorderImageOutset(ac, newexp, check);
+                                break;
+                            }
+                            throw new InvalidParamException("value", val.toString(),
+                                    getPropertyName(), ac);
+                    }
+                    break;
+                default:
+                    throw new InvalidParamException("value", val.toString(),
+                            getPropertyName(), ac);
+            }
+            if (op != SPACE) {
+                throw new InvalidParamException("operator",
+                        Character.toString(op),
+                        ac);
+            }
+        }
+        shorthand = true;
+    }
 
-	    if (val != null) {
+    public CssBorderImage(ApplContext ac, CssExpression expression)
+            throws InvalidParamException {
+        this(ac, expression, false);
+    }
 
-		if (val.equals(none)) {
-		    value += "none" + " ";
-		} else if (val instanceof CssURL) {
-		    value += val.toString() + " ";
-		} else {
-		    throw new InvalidParamException("value", expression.getValue(),
-			    getPropertyName(), ac);
-		}
+    private CssExpression getRepeatExpression(ApplContext ac, CssExpression expression)
+            throws InvalidParamException {
+        CssExpression exp = null;
+        CssValue val, tval;
+        char op;
 
-	    } else {
-		break;
-	    }
+        val = expression.getValue();
+        op = expression.getOperator();
+        if (val.getType() == CssTypes.CSS_IDENT) {
+            tval = CssBorderImageRepeat.getMatchingIdent((CssIdent) val);
+            if (tval == null) {
+                return null;
+            }
+            exp = new CssExpression();
+            exp.addValue(val);
+            expression.next();
+            if (!expression.end()) {
+                // now get the potential second value
+                // first check the operator
+                if (op != SPACE) {
+                    return exp;
+                }
+                val = expression.getValue();
+                op = expression.getOperator();
+                if (val.getType() == CssTypes.CSS_IDENT) {
+                    tval = CssBorderImageRepeat.getMatchingIdent((CssIdent) val);
+                    if (tval != null) {
+                        exp.addValue(tval);
+                        expression.next();
+                        if (op != SPACE) {
+                            return exp;
+                        }
+                    }
+                }
+            }
+        }
+        return exp;
+    }
 
-	    expression.next();
-	}
+    private CssExpression getSliceExpression(ApplContext ac, CssExpression expression)
+            throws InvalidParamException {
+        CssExpression exp = new CssExpression();
+        CssValue val, tval;
+        char op;
 
-	value = value.trim();
-    }
+        while (exp.getCount() < 5 && !expression.end()) {
+            val = expression.getValue();
+            op = expression.getOperator();
+            switch (val.getType()) {
+                case CssTypes.CSS_NUMBER:
+                case CssTypes.CSS_PERCENTAGE:
+                    exp.addValue(val);
+                    break;
+                case CssTypes.CSS_IDENT:
+                    tval = CssBorderImageSlice.getMatchingIdent((CssIdent) val);
+                    if (tval == null) {
+                        return exp;
+                    }
+                    exp.addValue(val);
+                    break;
+                default:
+                    return exp;
 
-    public CssBorderImage(ApplContext ac, CssExpression expression)
-	    throws InvalidParamException {
-	this(ac, expression, false);
+            }
+            expression.next();
+            if (op != SPACE) {
+                return exp;
+            }
+        }
+        return exp;
     }
 
-    /**
-     * Add this property to the CssStyle.
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	if (((Css3Style) style).cssBorderImage != null)
-	    style.addRedefinitionWarning(ac, this);
-	((Css3Style) style).cssBorderImage = this;
-    }
+    private CssExpression getWidthExpression(ApplContext ac, CssExpression expression)
+            throws InvalidParamException {
+        CssExpression exp = new CssExpression();
+        CssValue val, tval;
+        char op;
 
-    /**
-     * 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 ((Css3Style) style).getBorderImage();
-	} else {
-	    return ((Css3Style) style).cssBorderImage;
-	}
-    }
+        while (exp.getCount() < 4 && !expression.end()) {
+            val = expression.getValue();
+            op = expression.getOperator();
+            switch (val.getType()) {
+                case CssTypes.CSS_LENGTH:
+                case CssTypes.CSS_NUMBER:
+                case CssTypes.CSS_PERCENTAGE:
+                    exp.addValue(val);
+                    break;
+                case CssTypes.CSS_IDENT:
+                    tval = CssBorderImageWidth.getMatchingIdent((CssIdent) val);
+                    if (tval == null) {
+                        return exp;
+                    }
+                    exp.addValue(val);
+                    break;
+                default:
+                    return exp;
 
-    /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
-     */
-    public boolean equals(CssProperty property) {
-	return (property instanceof CssBorderImage &&
-		value.equals( ((CssBorderImage) property).value));
+            }
+            expression.next();
+            if (op != SPACE) {
+                return exp;
+            }
+        }
+        return exp;
     }
 
-    /**
-     * Returns the name of this property
-     */
-    public String getPropertyName() {
-	return "border-image";
-    }
+    private CssExpression getOutsetExpression(ApplContext ac, CssExpression expression)
+            throws InvalidParamException {
+        CssExpression exp = new CssExpression();
+        CssValue val, tval;
+        char op;
 
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return value;
-    }
+        while (exp.getCount() < 4 && !expression.end()) {
+            val = expression.getValue();
+            op = expression.getOperator();
+            switch (val.getType()) {
+                case CssTypes.CSS_LENGTH:
+                case CssTypes.CSS_NUMBER:
+                    exp.addValue(val);
+                    break;
+                default:
+                    return exp;
 
-    /**
-     * Returns true if this property is "softly" inherited
-     */
-    public boolean isSoftlyInherited() {
-	return value.equals(inherit);
+            }
+            expression.next();
+            if (op != SPACE) {
+                return exp;
+            }
+        }
+        return exp;
     }
 
-    /**
-     * Returns a string representation of the object
-     */
     public String toString() {
-	return value;
-    }
-
-    /**
-     * Is the value of this property a default value
-     * It is used by all macro for the function <code>print</code>
-     */
-    public boolean isDefault() {
-	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
-	return value == cssnum.toString();
+        if (value != null) {
+            return value.toString();
+        }
+        boolean first = true;
+        StringBuilder sb = new StringBuilder();
+        if (source != null) {
+            first = false;
+            sb.append(source);
+        }
+        if (slice != null) {
+            if (first) {
+                first = false;
+            } else {
+                sb.append(' ');
+            }
+            sb.append(slice);
+            if (width != null) {
+                sb.append(" / ").append(width);
+                if (outset != null) {
+                    sb.append(" / ").append(outset);
+                }
+            } else if (outset != null) {
+                sb.append(" / / ").append(outset);
+            }
+        }
+        if (repeat != null) {
+            if (!first) {
+                sb.append(' ');
+            }
+            sb.append(repeat);
+        }
+        return sb.toString();
     }
-
 }

--- CssBorderImageTransform.java DELETED ---

--- CssBorderBottomRightFitLength.java DELETED ---

--- NEW FILE: CssBorderLeftWidth.java ---
// $Id: CssBorderLeftWidth.java,v 1.1 2012/04/25 20:22:06 ylafon Exp $
// Author: Yves Lafon <http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#value-def-border-width
 * @version $Revision: 1.1 $
 */
public class CssBorderLeftWidth extends org.w3c.css.properties.css.CssBorderLeftWidth {

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

    /**
     * Creates a new CssBorderLeftWidth
     *
     * @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 {
        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);
    }

}


Index: CssBorderTopLeftRadius.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBorderTopLeftRadius.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBorderTopLeftRadius.java	5 Jan 2010 13:49:50 -0000	1.4
+++ CssBorderTopLeftRadius.java	25 Apr 2012 20:22:07 -0000	1.5
@@ -1,40 +1,24 @@
-//
 // $Id$
-// From Sijtsche de Jong (http://www.w3.org/Consortium/Legal/copyright-software-19980720
 
 package org.w3c.css.properties.css3;
 
-import org.w3c.css.parser.CssStyle;
-import org.w3c.css.properties.css.CssProperty;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
-import org.w3c.css.values.CssNumber;
-import org.w3c.css.values.CssOperator;
 import org.w3c.css.values.CssTypes;
-import org.w3c.css.values.CssValue;
-
-public class CssBorderTopLeftRadius extends CssProperty {
-
-    String value;
-    ApplContext ac;
-
-    private static String defaultValue;
-    private final static String propertyName = "border-top-left-radius";
+import org.w3c.css.values.CssValueList;
 
-    static {
-	defaultValue = (new CssNumber((float) 1.0)).toString();
-    }
+public class CssBorderTopLeftRadius extends org.w3c.css.properties.css.CssBorderTopLeftRadius {
 
     /**
      * Create new CssBorderTopLeftRadius
      */
     public CssBorderTopLeftRadius() {
-	value = defaultValue;
+        value = initial;
     }
 
     /**
@@ -45,126 +29,15 @@
      */
     public CssBorderTopLeftRadius(ApplContext ac, CssExpression expression,
 	    boolean check) throws InvalidParamException {
-	setByUser();
-	CssValue val = expression.getValue();
-	char op = expression.getOperator();
-	StringBuilder sb = new StringBuilder();
-
-	if (op != CssOperator.SPACE) {
-	    throw new InvalidParamException("operator", Character.toString(op),
-					    ac);
-	}
-	switch (val.getType()) {
-	case CssTypes.CSS_NUMBER:
-	    val = ((CssNumber)val).getLength();
-	case CssTypes.CSS_LENGTH:
-	    sb.append(val.toString());
-	    
-	    expression.next();
-	    val = expression.getValue();
-	    op = expression.getOperator();
-	    if (val != null) {
-		if (op != CssOperator.SPACE) {
-		    throw new InvalidParamException("operator", 
-						    Character.toString(op),
-						    ac);
-		}
-		switch (val.getType()) {
-		case CssTypes.CSS_NUMBER:
-		    val = ((CssNumber)val).getLength();
-		case CssTypes.CSS_LENGTH:
-		    sb.append(' ').append(val.toString());
-		    expression.next();
-		    break;
-		default:
-		    throw new InvalidParamException("value", 
-						    val,
-						    getPropertyName(), ac);
-		}
-	    }
-	    value = sb.toString();
-	    break;
-	default:
-	    throw new InvalidParamException("value", 
-					    val,
-					    getPropertyName(), ac);
-	}
-    }
-    
-    public CssBorderTopLeftRadius(ApplContext ac, CssExpression expression)
-	    throws InvalidParamException {
-	this(ac, expression, false);
-    }
-
-    /**
-     * Add this property to the CssStyle.
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	if (((Css3Style) style).cssBorderTopLeftRadius != null)
-	    style.addRedefinitionWarning(ac, this);
-	((Css3Style) style).cssBorderTopLeftRadius = 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 ((Css3Style) style).getBorderTopLeftRadius();
-	} else {
-	    return ((Css3Style) style).cssBorderTopLeftRadius;
-	}
-    }
-
-    /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
-     */
-    public boolean equals(CssProperty property) {
-	return (property instanceof CssBorderTopLeftRadius &&
-		value.equals( ((CssBorderTopLeftRadius) property).value));
-    }
-
-    /**
-     * Returns the name of this property
-     */
-    public final String getPropertyName() {
-	return propertyName;
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return value;
-    }
-
-    /**
-     * Returns true if this property is "softly" inherited
-     */
-    public boolean isSoftlyInherited() {
-	return inherit.equals(value);
-    }
-    
-    /**
-     * Returns a string representation of the object
-     */
-    public String toString() {
-	return value;
-    }
-
-    /**
-     * Is the value of this property a default value
-     * It is used by all macro for the function <code>print</code>
-     */
-    public boolean isDefault() {
-	return  (defaultValue == value);
+        setByUser();
+        value = CssBorderRadius.checkBorderCornerRadius(ac, this, expression, check);
+        if (value.getType() == CssTypes.CSS_VALUE_LIST) {
+            CssValueList vl = (CssValueList) value;
+            h_radius = vl.get(0);
+            v_radius = vl.get(1);
+        } else {
+            h_radius = v_radius = value;
+        }
     }
 
 }

Index: CssBorderBottomRightRadius.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBorderBottomRightRadius.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBorderBottomRightRadius.java	5 Jan 2010 13:49:49 -0000	1.4
+++ CssBorderBottomRightRadius.java	25 Apr 2012 20:22:04 -0000	1.5
@@ -1,40 +1,24 @@
-//
 // $Id$
-// From Sijtsche de Jong (http://www.w3.org/Consortium/Legal/copyright-software-19980720
 
 package org.w3c.css.properties.css3;
 
-import org.w3c.css.parser.CssStyle;
-import org.w3c.css.properties.css.CssProperty;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
-import org.w3c.css.values.CssNumber;
-import org.w3c.css.values.CssOperator;
 import org.w3c.css.values.CssTypes;
-import org.w3c.css.values.CssValue;
-
-public class CssBorderBottomRightRadius extends CssProperty {
-
-    String value;
-    ApplContext ac;
+import org.w3c.css.values.CssValueList;
 
-    private static final String defaultValue;
-    private final static String propertyName = "border-bottom-right-radius";
-    
-    static {
-	defaultValue = (new CssNumber((float) 1.0)).toString();
-    }
+public class CssBorderBottomRightRadius extends org.w3c.css.properties.css.CssBorderBottomRightRadius {
 
     /**
      * Create new CssBorderBottomRightRadius
      */
     public CssBorderBottomRightRadius() {
-	value = defaultValue;
+        value = initial;
     }
 
     /**
@@ -45,126 +29,14 @@
      */
     public CssBorderBottomRightRadius(ApplContext ac, CssExpression expression,
 	    boolean check) throws InvalidParamException {
-	setByUser();
-	CssValue val = expression.getValue();
-	char op = expression.getOperator();
-	StringBuilder sb = new StringBuilder();
-
-	if (op != CssOperator.SPACE) {
-	    throw new InvalidParamException("operator", Character.toString(op),
-					    ac);
-	}
-	switch (val.getType()) {
-	case CssTypes.CSS_NUMBER:
-	    val = ((CssNumber)val).getLength();
-	case CssTypes.CSS_LENGTH:
-	    sb.append(val.toString());
-	    
-	    expression.next();
-	    val = expression.getValue();
-	    op = expression.getOperator();
-	    if (val != null) {
-		if (op != CssOperator.SPACE) {
-		    throw new InvalidParamException("operator", 
-						    Character.toString(op),
-						    ac);
-		}
-		switch (val.getType()) {
-		case CssTypes.CSS_NUMBER:
-		    val = ((CssNumber)val).getLength();
-		case CssTypes.CSS_LENGTH:
-		    sb.append(' ').append(val.toString());
-		    expression.next();
-		    break;
-		default:
-		    throw new InvalidParamException("value", 
-						    val,
-						    getPropertyName(), ac);
-		}
-	    }
-	    value = sb.toString();
-	    break;
-	default:
-	    throw new InvalidParamException("value", 
-					    val,
-					    getPropertyName(), ac);
-	}
-    }
-
-    public CssBorderBottomRightRadius(ApplContext ac, CssExpression expression)
-	    throws InvalidParamException {
-	this(ac, expression, false);
-    }
-
-    /**
-     * Add this property to the CssStyle.
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	if (((Css3Style) style).cssBorderBottomRightRadius != null)
-	    style.addRedefinitionWarning(ac, this);
-	((Css3Style) style).cssBorderBottomRightRadius = 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 ((Css3Style) style).getBorderBottomRightRadius();
-	} else {
-	    return ((Css3Style) style).cssBorderBottomRightRadius;
-	}
-    }
-
-    /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
-     */
-    public boolean equals(CssProperty property) {
-	return (property instanceof CssBorderBottomRightRadius &&
-		value.equals( ((CssBorderBottomRightRadius) property).value));
-    }
-
-    /**
-     * Returns the name of this property
-     */
-    public final String getPropertyName() {
-	return propertyName;
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return value;
-    }
-
-    /**
-     * Returns true if this property is "softly" inherited
-     */
-    public boolean isSoftlyInherited() {
-	return value.equals(inherit);
-    }
-
-    /**
-     * Returns a string representation of the object
-     */
-    public String toString() {
-	return value.toString();
-    }
-
-    /**
-     * Is the value of this property a default value
-     * It is used by all macro for the function <code>print</code>
-     */
-    public boolean isDefault() {
-	return (defaultValue == value);
+        setByUser();
+        value = CssBorderRadius.checkBorderCornerRadius(ac, this, expression, check);
+        if (value.getType() == CssTypes.CSS_VALUE_LIST) {
+            CssValueList vl = (CssValueList) value;
+            h_radius = vl.get(0);
+            v_radius = vl.get(1);
+        } else {
+            h_radius = v_radius = value;
+        }
     }
-
 }

--- CssBorderBottomImage.java DELETED ---

Index: CssColumnRuleStyle.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssColumnRuleStyle.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- CssColumnRuleStyle.java	23 Oct 2011 14:42:32 -0000	1.10
+++ CssColumnRuleStyle.java	25 Apr 2012 20:22:07 -0000	1.11
@@ -11,12 +11,9 @@
 package org.w3c.css.properties.css3;
 
 import org.w3c.css.properties.css.CssProperty;
-import org.w3c.css.properties.css1.CssBorderStyleCSS2;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
-import org.w3c.css.values.CssIdent;
-import org.w3c.css.values.CssTypes;
 import org.w3c.css.values.CssValue;
 
 /**
@@ -25,7 +22,7 @@
 
 public class CssColumnRuleStyle extends org.w3c.css.properties.css.CssColumnRuleStyle {
 
-    CssIdent value;
+    CssValue value;
 
     /**
      * Create a new CssColumnRuleStyle
@@ -46,28 +43,7 @@
                               boolean check) throws InvalidParamException {
 
         setByUser();
-        CssValue val = expression.getValue();
-        // too many values
-        if (check && expression.getCount() > 1) {
-            throw new InvalidParamException("unrecognize", ac);
-        }
-        // we only use Css Ident part of the CssBorderStyle acceptable values
-        if (val.getType() != CssTypes.CSS_IDENT) {
-            throw new InvalidParamException("value",
-                    expression.getValue(),
-                    getPropertyName(), ac);
-        }
-        CssIdent ident = (CssIdent) val;
-        if (inherit.equals(ident)) {
-            value = inherit;
-        } else if (CssBorderStyleCSS2.acceptable_values.contains(ident)) {
-            value = ident;
-        } else {
-            throw new InvalidParamException("value",
-                    expression.getValue(),
-                    getPropertyName(), ac);
-        }
-        expression.next();
+        value = CssBorderStyle.checkBorderSideStyle(ac, this, expression, check);
     }
 
     public CssColumnRuleStyle(ApplContext ac, CssExpression expression)

--- NEW FILE: CssBorderImageOutset.java ---
// $Id: CssBorderImageOutset.java,v 1.1 2012/04/25 20:22:05 ylafon Exp $
// Author: Yves Lafon <http://www.w3.org/TR/2012/CR-css3-background-20120417/#the-border-image-outset
 */
public class CssBorderImageOutset extends org.w3c.css.properties.css.CssBorderImageOutset {

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

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

        CssValueList valueList = new CssValueList();
        if (check && expression.getCount() > 4) {
            throw new InvalidParamException("unrecognize", ac);
        }
        CssValue val;
        char op;

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

            switch (val.getType()) {
                case CssTypes.CSS_NUMBER:
                    CssNumber num = (CssNumber)val;
                    if (!num.isPositive()) {
                        throw new InvalidParamException("negative-value", num,
                                getPropertyName(), ac);
                    }
                    valueList.add(val);
                    break;
                case CssTypes.CSS_LENGTH:
                    CssLength length = (CssLength)val;
                    if (!length.isPositive()) {
                        throw new InvalidParamException("negative-value", length,
                                getPropertyName(), ac);
                    }
                    valueList.add(val);
                    break;
                case CssTypes.CSS_IDENT:
                    if (inherit.equals(val)) {
                        if (expression.getCount() > 1) {
                            throw new InvalidParamException("unrecognize", ac);
                        }
                        valueList.add(inherit);
                        break;
                    }
                    // unrecognized ident, let it fail
                default:
                    throw new InvalidParamException("value", val.toString(),
                            getPropertyName(), ac);
            }
            expression.next();
            if (op != SPACE) {
                throw new InvalidParamException("operator",
                        Character.toString(op),
                        ac);
            }
        }
        value = (valueList.size() == 1) ? valueList.get(0) : valueList;
    }

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


--- NEW FILE: CssBorderLeft.java ---
// $Id: CssBorderLeft.java,v 1.1 2012/04/25 20:22:05 ylafon Exp $
// @author Yves Lafon <http://www.w3.org/TR/2012/CR-css3-background-20120417/#the-border-image-width
 */
public class CssBorderImageWidth extends org.w3c.css.properties.css.CssBorderImageWidth {

    public static final CssIdent auto;

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

    public final static CssIdent getMatchingIdent(CssIdent ident) {
        return (auto.equals(ident)) ? auto : null;
    }

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

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

        CssValueList valueList = new CssValueList();
        if (check && expression.getCount() > 4) {
            throw new InvalidParamException("unrecognize", ac);
        }
        CssValue val;
        char op;

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

            switch (val.getType()) {
                case CssTypes.CSS_NUMBER:
                    CssNumber num = (CssNumber)val;
                    if (!num.isPositive()) {
                        throw new InvalidParamException("negative-value", num,
                                getPropertyName(), ac);
                    }
                    valueList.add(val);
                    break;
                case CssTypes.CSS_LENGTH:
                    CssLength length = (CssLength)val;
                    if (!length.isPositive()) {
                        throw new InvalidParamException("negative-value", length,
                                getPropertyName(), ac);
                    }
                    valueList.add(val);
                    break;
                case CssTypes.CSS_PERCENTAGE:
                    CssPercentage percent = (CssPercentage) val;
                    if (!percent.isPositive()) {
                        throw new InvalidParamException("negative-value", percent,
                                getPropertyName(), ac);
                    }
                    valueList.add(val);
                    break;
                case CssTypes.CSS_IDENT:
                    if (inherit.equals(val)) {
                        if (expression.getCount() > 1) {
                            throw new InvalidParamException("unrecognize", ac);
                        }
                        valueList.add(inherit);
                        break;
                    }
                    if (auto.equals(val)) {
                        // fill is first or last and can't appear twice
                        valueList.add(auto);
                        break;
                    }
                    // unrecognized ident, let it fail
                default:
                    throw new InvalidParamException("value", val.toString(),
                            getPropertyName(), ac);
            }
            expression.next();
            if (op != SPACE) {
                throw new InvalidParamException("operator",
                        Character.toString(op),
                        ac);
            }
        }
        value = (valueList.size() == 1) ? valueList.get(0) : valueList;
    }

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


--- CssBorderLeftFitLength.java DELETED ---

--- CssBorderFit.java DELETED ---

--- NEW FILE: CssBorderColor.java ---
// $Id: CssBorderColor.java,v 1.1 2012/04/25 20:22:04 ylafon Exp $
// @author Yves Lafon <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
     */
    public CssBorderColor() {
        value = initial;
        top = new CssBorderTopColor();
        right = new CssBorderRightColor();
        bottom = new CssBorderBottomColor();
        left = new CssBorderLeftColor();
    }

    /**
     * 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 CssBorderColor(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * 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 CssBorderColor(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
        if (check && expression.getCount() > 4) {
            throw new InvalidParamException("unrecognize", ac);
        }
        setByUser();
        CssValue val;
        char op;

        ArrayList<CssValue> res = new ArrayList<CssValue>();
        while (res.size() < 4 && !expression.end()) {
            val = expression.getValue();
            op = expression.getOperator();

            if (inherit.equals(val)) {
                res.add(inherit);
            } else {
                try {
                    CssExpression ex = new CssExpression();
                    ex.addValue(val);
                    // we use the latest version of CssColor, aka CSS3
                    CssColor tcolor = new CssColor(ac, ex, check);
                    // instead of using getColor, we get the value directly
                    // as we can have idents
                    res.add(tcolor.color);
                } catch (InvalidParamException e) {
                    throw new InvalidParamException("value",
                            val.toString(),
                            getPropertyName(), 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);

        // now assign the computed values...
        top = new CssBorderTopColor();
        right = new CssBorderRightColor();
        bottom = new CssBorderBottomColor();
        left = new CssBorderLeftColor();

        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);
        }
        shorthand = true;
    }

    /**
     * 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.
     */
    protected static CssValue checkBorderSideColor(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();

        if (inherit.equals(val)) {
            retval = inherit;
        } else {
            try {
                // we use the latest version of CssColor, aka CSS3
                CssColor tcolor = new CssColor(ac, expression, check);
                // instead of using getColor, we get the value directly
                // as we can have idents
                retval = tcolor.color;
            } catch (InvalidParamException e) {
                throw new InvalidParamException("value",
                        val.toString(),
                        caller.getPropertyName(), ac);
            }
        }
        expression.next();
        return retval;
    }
}

--- CssBorderCornerFit.java DELETED ---

--- NEW FILE: CssBorderRightStyle.java ---
// $Id: CssBorderRightStyle.java,v 1.1 2012/04/25 20:22:06 ylafon Exp $
// Author: Yves Lafon <http://www.w3.org/TR/2012/CR-css3-background-20120417/#the-border-image-source
 * @version $Revision: 1.1 $
 */
public class CssBorderImageSource extends org.w3c.css.properties.css.CssBorderImageSource {


    public static boolean isMatchingIdent(CssIdent ident) {
        return none.equals(ident);
    }

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

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

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

        }
        CssValue val = expression.getValue();
        switch (val.getType()) {
            case CssTypes.CSS_URL:
                value = val;
                break;
            case CssTypes.CSS_IDENT:
                if (inherit.equals(val)) {
                    value = inherit;
                    break;
                } else if (none.equals(val)) {
                    value = none;
                    break;
                }
                // unrecognized ident... let it fail
            default:
                throw new InvalidParamException("value", val.toString(),
                        getPropertyName(), ac);
        }
        expression.next();

    }

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


Index: CssBorderRadius.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBorderRadius.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CssBorderRadius.java	5 Jan 2010 13:49:50 -0000	1.5
+++ CssBorderRadius.java	25 Apr 2012 20:22:06 -0000	1.6
@@ -1,171 +1,243 @@
-//
 // $Id$
-// From Sijtsche de Jong (http://www.w3.org/Consortium/Legal/copyright-software-19980720
 
 package org.w3c.css.properties.css3;
 
-import org.w3c.css.parser.CssStyle;
 import org.w3c.css.properties.css.CssProperty;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssLength;
 import org.w3c.css.values.CssNumber;
+import org.w3c.css.values.CssPercentage;
+import org.w3c.css.values.CssSwitch;
 import org.w3c.css.values.CssTypes;
-import org.w3c.css.values.CssOperator;
 import org.w3c.css.values.CssValue;
+import org.w3c.css.values.CssValueList;
 
+import java.util.ArrayList;
 
+import static org.w3c.css.values.CssOperator.SPACE;
 
-public class CssBorderRadius extends CssProperty {
 
-    String value;
-    ApplContext ac;
+public class CssBorderRadius extends org.w3c.css.properties.css.CssBorderRadius {
+
 
-    private static String defaultValue;
-    
-    static {
-	defaultValue = (new CssNumber((float) 1.0)).toString();
-    }
-    
     /**
      * Create new CssBorderRadius
      */
     public CssBorderRadius() {
-	value = defaultValue;
+        value = initial;
+        topLeft = new CssBorderTopLeftRadius();
+        topRight = new CssBorderTopRightRadius();
+        bottomLeft = new CssBorderBottomLeftRadius();
+        bottomRight = new CssBorderBottomRightRadius();
     }
 
     /**
      * Create new CssBorderRadius
      *
      * @param expression The expression for this property
-     * @exception InvalidParamException Values are incorrect
+     * @throws InvalidParamException Values are incorrect
      */
     public CssBorderRadius(ApplContext ac, CssExpression expression,
-			   boolean check) throws InvalidParamException {
-	setByUser();
-	CssValue val = expression.getValue();
-	char op = expression.getOperator();
-	StringBuilder sb = new StringBuilder();
+                           boolean check) throws InvalidParamException {
+        if (check && expression.getCount() > 9) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        setByUser();
+        CssValue val;
+        char op;
+        boolean switched = false;
 
-	if (op != CssOperator.SPACE) {
-	    throw new InvalidParamException("operator", Character.toString(op),
-					    ac);
-	}
-	switch (val.getType()) {
-	case CssTypes.CSS_NUMBER:
-	    val = ((CssNumber)val).getLength();
-	case CssTypes.CSS_LENGTH:
-	    sb.append(val.toString());
-	    
-	    expression.next();
-	    val = expression.getValue();
-	    op = expression.getOperator();
-	    if (val != null) {
-		if (op != CssOperator.SPACE) {
-		    throw new InvalidParamException("operator", 
-						    Character.toString(op),
-						    ac);
-		}
-		switch (val.getType()) {
-		case CssTypes.CSS_NUMBER:
-		    val = ((CssNumber)val).getLength();
-		case CssTypes.CSS_LENGTH:
-		    sb.append(' ').append(val.toString());
-		    expression.next();
-		    break;
-		default:
-		    throw new InvalidParamException("value", 
-						    val,
-						    getPropertyName(), ac);
-		}
-	    }
-	    value = sb.toString();
-	    break;
-	default:
-	    throw new InvalidParamException("value", 
-					    val,
-					    getPropertyName(), ac);
-	}
-    }
-    
-    public CssBorderRadius(ApplContext ac, CssExpression expression)
-	throws InvalidParamException {
-	this(ac, expression, false);
-    }
-    
-    /**
-     * Add this property to the CssStyle.
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	Css3Style c3style = (Css3Style) style;
-	if (c3style.cssBorderRadius != null)
-	    style.addRedefinitionWarning(ac, this);
-	c3style.cssBorderRadius = this;
-    }
+        ArrayList<CssValue> h_radius = new ArrayList<CssValue>();
+        ArrayList<CssValue> v_radius = new ArrayList<CssValue>();
+        ArrayList<CssValue> cur_radius = h_radius;
 
-    /**
-     * 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 ((Css3Style) style).getBorderRadius();
-	} else {
-	    return ((Css3Style) style).cssBorderRadius;
-	}
-    }
+        while (!expression.end() && h_radius.size() < 4 && v_radius.size() < 4) {
+            val = expression.getValue();
+            op = expression.getOperator();
+            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);
+                    }
+                    cur_radius.add(length);
+                    break;
+                case CssTypes.CSS_PERCENTAGE:
+                    CssPercentage percentage = (CssPercentage) val;
+                    if (!percentage.isPositive()) {
+                        throw new InvalidParamException("negative-value", expression.getValue(),
+                                getPropertyName(), ac);
+                    }
+                    cur_radius.add(percentage);
+                    break;
+                case CssTypes.CSS_SWITCH:
+                    if (switched) {
+                        throw new InvalidParamException("operator",
+                                val.toString(), ac);
+                    }
+                    switched = true;
+                    cur_radius = v_radius;
+                    break;
+                case CssTypes.CSS_IDENT:
+                    if (inherit.equals(val)) {
+                        if (expression.getCount() > 1) {
+                            throw new InvalidParamException("unrecognize", ac);
+                        }
+                        cur_radius.add(inherit);
+                        break;
+                    }
+                default:
+                    throw new InvalidParamException("unrecognize", ac);
+            }
+            expression.next();
+            if (op != SPACE) {
+                throw new InvalidParamException("operator",
+                        Character.toString(op),
+                        ac);
+            }
+        }
+        if (v_radius.size() == 0) {
+            value = new CssValueList(h_radius);
+        } else {
+            CssValueList vlist = new CssValueList();
+            for (CssValue h : h_radius) {
+                vlist.add(h);
+            }
+            vlist.add(new CssSwitch());
+            for (CssValue v : v_radius) {
+                vlist.add(v);
+            }
+            value = vlist;
+        }
+        // now assign the computed values...
+        topLeft = new CssBorderTopLeftRadius();
+        topRight = new CssBorderTopRightRadius();
+        bottomLeft = new CssBorderBottomLeftRadius();
+        bottomRight = new CssBorderBottomRightRadius();
 
-    /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
-     */
-    public boolean equals(CssProperty property) {
-	return (property instanceof CssBorderRadius &&
-		value.equals( ((CssBorderRadius) property).value));
+        switch (h_radius.size()) {
+            case 1:
+                topLeft.h_radius = topRight.h_radius = bottomLeft.h_radius = bottomRight.h_radius = h_radius.get(0);
+                break;
+            case 2:
+                topLeft.h_radius = bottomRight.h_radius = h_radius.get(0);
+                topRight.h_radius = bottomLeft.h_radius = h_radius.get(1);
+                break;
+            case 3:
+                topLeft.h_radius = h_radius.get(0);
+                topRight.h_radius = bottomLeft.h_radius = h_radius.get(1);
+                bottomRight.h_radius = h_radius.get(2);
+                break;
+            case 4:
+                topLeft.h_radius = h_radius.get(0);
+                topRight.h_radius = h_radius.get(1);
+                bottomRight.h_radius = h_radius.get(2);
+                bottomLeft.h_radius = h_radius.get(3);
+                break;
+            default:
+                // can't happen
+                throw new InvalidParamException("unrecognize", ac);
+        }
+        switch (v_radius.size()) {
+            case 0:
+                // v = h
+                topLeft.v_radius = topRight.v_radius = bottomLeft.v_radius = bottomRight.v_radius = h_radius.get(0);
+                break;
+            case 1:
+                topLeft.v_radius = topRight.v_radius = bottomLeft.v_radius = bottomRight.v_radius = v_radius.get(0);
+                break;
+            case 2:
+                topLeft.v_radius = bottomRight.v_radius = v_radius.get(0);
+                topRight.v_radius = bottomLeft.v_radius = v_radius.get(1);
+                break;
+            case 3:
+                topLeft.v_radius = v_radius.get(0);
+                topRight.v_radius = bottomLeft.v_radius = v_radius.get(1);
+                bottomRight.v_radius = v_radius.get(2);
+                break;
+            case 4:
+                topLeft.v_radius = v_radius.get(0);
+                topRight.v_radius = v_radius.get(1);
+                bottomRight.v_radius = v_radius.get(2);
+                bottomLeft.v_radius = v_radius.get(3);
+                break;
+            default:
+                // can't happen
+                throw new InvalidParamException("unrecognize", ac);
+        }
+        shorthand = true;
     }
 
-    /**
-     * Returns the name of this property
-     */
-    public String getPropertyName() {
-	return "border-radius";
+    public CssBorderRadius(ApplContext ac, CssExpression expression)
+            throws InvalidParamException {
+        this(ac, expression, false);
     }
 
     /**
-     * Returns the value of this property
+     * Check the border-*-radius and returns a value.
+     * It makes sense to do it only once for all the corners, so by having the code here.
      */
-    public Object get() {
-	return value;
-    }
+    protected static CssValue checkBorderCornerRadius(ApplContext ac, CssProperty caller,
+                                                      CssExpression expression, boolean check)
+            throws InvalidParamException {
 
-    /**
-     * Returns true if this property is "softly" inherited
-     */
-    public boolean isSoftlyInherited() {
-	return value.equals(inherit);
-    }
+        if (check && expression.getCount() > 2) {
+            throw new InvalidParamException("unrecognize", ac);
+        }
+        CssValue val;
+        CssValueList res = new CssValueList();
+        char op;
 
-    /**
-     * Returns a string representation of the object
-     */
-    public String toString() {
-	return value;
-    }
+        while (!expression.end()) {
+            val = expression.getValue();
+            op = expression.getOperator();
 
-    /**
-     * Is the value of this property a default value
-     * It is used by all macro for the function <code>print</code>
-     */
-    public boolean isDefault() {
-	return (defaultValue == value);
+            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);
+                    }
+                    res.add(length);
+                    break;
+                case CssTypes.CSS_PERCENTAGE:
+                    CssPercentage percentage = (CssPercentage) val;
+                    if (!percentage.isPositive()) {
+                        throw new InvalidParamException("negative-value", expression.getValue(),
+                                caller.getPropertyName(), ac);
+                    }
+                    res.add(percentage);
+                    break;
+                case CssTypes.CSS_IDENT:
+                    if (inherit.equals((val))) {
+                        if (res.size() > 0) {
+                            throw new InvalidParamException("unrecognize", ac);
+                        }
+                        res.add(inherit);
+                        break;
+                    }
+                default:
+                    throw new InvalidParamException("unrecognize", ac);
+            }
+            if (op != SPACE) {
+                throw new InvalidParamException("operator",
+                        Character.toString(op),
+                        ac);
+            }
+            expression.next();
+        }
+        return (res.size() == 1) ? res.get(0) : res;
     }
 }

--- CssBorderRightFitLength.java DELETED ---

--- CssBorderTopLeftImage.java DELETED ---

--- CssBorderBottomLeftFitWidth.java DELETED ---

Index: CssColumnRuleWidth.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssColumnRuleWidth.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- CssColumnRuleWidth.java	23 Oct 2011 14:42:32 -0000	1.8
+++ CssColumnRuleWidth.java	25 Apr 2012 20:22:07 -0000	1.9
@@ -9,7 +9,6 @@
 package org.w3c.css.properties.css3;
 
 import org.w3c.css.properties.css.CssProperty;
-import org.w3c.css.properties.css1.CssBorderFaceWidthCSS2;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
@@ -42,21 +41,9 @@
                               boolean check) throws InvalidParamException {
 
         setByUser();
-        CssValue val = expression.getValue();
-
-        if (check && expression.getCount() > 1) {
-            throw new InvalidParamException("unrecognize", ac);
-        }
-
-        try {
-            CssBorderFaceWidthCSS2 _spec;
-            _spec = new CssBorderFaceWidthCSS2(ac, expression);
-            value = _spec.getValue();
-        } catch (InvalidParamException e) {
-            throw new InvalidParamException("value",
-                    expression.getValue(),
-                    getPropertyName(), ac);
-        }
+        // value is a border-width. in the CR spec it is a CSS2.1 border width
+        // but we will use the CSS3 value here.
+        value = CssBorderWidth.checkBorderSideWidth(ac, this, expression, check);
     }
 
     public CssColumnRuleWidth(ApplContext ac, CssExpression expression)

--- CssBorderTopFitWidth.java DELETED ---

--- CssBorderTopRightFitLength.java DELETED ---

--- CssBorderTopRightFitWidth.java DELETED ---

--- NEW FILE: CssBorderTopWidth.java ---
// $Id: CssBorderTopWidth.java,v 1.1 2012/04/25 20:22:07 ylafon Exp $
// Author: Yves Lafon <http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#border-shorthand-properties
 */
public class CssBorder extends org.w3c.css.properties.css.CssBorder {

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

    /**
     * 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 CssBorder(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * 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 CssBorder(ApplContext ac, CssExpression expression,
                     boolean check) throws InvalidParamException {
        // great, it's the same thing as one side!
        CssValueList valueList = new CssValueList();

        SideValues values = checkBorderSide(ac, this, expression, check);
        shorthand = true;
        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;
    }

    /**
     * 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.
     */
    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;
        CssExpression nex;

        CssValue val;
        char op;

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

            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
                            nex = new CssExpression();
                            nex.addValue(val);
                            CssColor cssColor = new CssColor(ac, nex, false);
                            _color = cssColor.color;
                        }
                    }
                    break;
                case CssTypes.CSS_FUNCTION:
                    nex = new CssExpression();
                    nex.addValue(val);
                    CssColor cssColor = new CssColor(ac, nex, false);
                    _color = cssColor.color;
                    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);
    }

    // small wrapper to return values...
    protected static class SideValues {
        CssValue width;
        CssValue style;
        CssValue color;

        SideValues(CssValue width, CssValue style, CssValue color) {
            this.width = width;
            this.style = style;
            this.color = color;

        }
    }
}

--- CssBorderBottomFitWidth.java DELETED ---

--- CssBorderTopLeftFitWidth.java DELETED ---

--- CssBorderRightFitWidth.java DELETED ---

--- CssBorderTopImage.java DELETED ---

--- CssBorderBottomFitLength.java DELETED ---

--- NEW FILE: CssBorderLeftStyle.java ---
// $Id: CssBorderLeftStyle.java,v 1.1 2012/04/25 20:22:06 ylafon Exp $
// Author: Yves Lafon <http://www.w3.org/Consortium/Legal/copyright-software-19980720
 
 package org.w3c.css.properties.css3;
 
-import org.w3c.css.parser.CssStyle;
-import org.w3c.css.properties.css.CssProperty;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
-import org.w3c.css.values.CssNumber;
-import org.w3c.css.values.CssOperator;
 import org.w3c.css.values.CssTypes;
-import org.w3c.css.values.CssValue;
-
-public class CssBorderTopRightRadius extends CssProperty {
+import org.w3c.css.values.CssValueList;
 
-    String value;
-    ApplContext ac;
+public class CssBorderTopRightRadius extends org.w3c.css.properties.css.CssBorderTopRightRadius {
 
-    private static final String defaultValue;
-    private final static String propertyName = "border-top-right-radius";
-   
-    static {
-	defaultValue = (new CssNumber((float) 1.0)).toString();
-    }
-    
     /**
      * Create new CssBorderTopRightRadius
      */
     public CssBorderTopRightRadius() {
-	value = defaultValue;
+        value = initial;
     }
 
     /**
@@ -45,126 +29,15 @@
      */
     public CssBorderTopRightRadius(ApplContext ac, CssExpression expression,
 				   boolean check) throws InvalidParamException {
-	setByUser();
-	CssValue val = expression.getValue();
-	char op = expression.getOperator();
-	StringBuilder sb = new StringBuilder();
-
-	if (op != CssOperator.SPACE) {
-	    throw new InvalidParamException("operator", Character.toString(op),
-					    ac);
-	}
-	switch (val.getType()) {
-	case CssTypes.CSS_NUMBER:
-	    val = ((CssNumber)val).getLength();
-	case CssTypes.CSS_LENGTH:
-	    sb.append(val.toString());
-	    
-	    expression.next();
-	    val = expression.getValue();
-	    op = expression.getOperator();
-	    if (val != null) {
-		if (op != CssOperator.SPACE) {
-		    throw new InvalidParamException("operator", 
-						    Character.toString(op),
-						    ac);
-		}
-		switch (val.getType()) {
-		case CssTypes.CSS_NUMBER:
-		    val = ((CssNumber)val).getLength();
-		case CssTypes.CSS_LENGTH:
-		    sb.append(' ').append(val.toString());
-		    expression.next();
-		    break;
-		default:
-		    throw new InvalidParamException("value", 
-						    val,
-						    getPropertyName(), ac);
-		}
-	    }
-	    value = sb.toString();
-	    break;
-	default:
-	    throw new InvalidParamException("value", 
-					    val,
-					    getPropertyName(), ac);
-	}
-    }
-
-    public CssBorderTopRightRadius(ApplContext ac, CssExpression expression)
-	throws InvalidParamException {
-	this(ac, expression, false);
-    }
-
-    /**
-     * Add this property to the CssStyle.
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	if (((Css3Style) style).cssBorderTopRightRadius != null)
-	    style.addRedefinitionWarning(ac, this);
-	((Css3Style) style).cssBorderTopRightRadius = 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 ((Css3Style) style).getBorderTopRightRadius();
-	} else {
-	    return ((Css3Style) style).cssBorderTopRightRadius;
-	}
-    }
-
-    /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
-     */
-    public boolean equals(CssProperty property) {
-	return (property instanceof CssBorderTopRightRadius &&
-		value.equals( ((CssBorderTopRightRadius) property).value));
-    }
-
-    /**
-     * Returns the name of this property
-     */
-    public final String getPropertyName() {
-	return propertyName;
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return value;
-    }
-
-    /**
-     * Returns true if this property is "softly" inherited
-     */
-    public boolean isSoftlyInherited() {
-	return value.equals(inherit);
-    }
-
-    /**
-     * Returns a string representation of the object
-     */
-    public String toString() {
-	return value.toString();
-    }
-
-    /**
-     * Is the value of this property a default value
-     * It is used by all macro for the function <code>print</code>
-     */
-    public boolean isDefault() {
-	return (defaultValue == value);
+        setByUser();
+        value = CssBorderRadius.checkBorderCornerRadius(ac, this, expression, check);
+        if (value.getType() == CssTypes.CSS_VALUE_LIST) {
+            CssValueList vl = (CssValueList) value;
+            h_radius = vl.get(0);
+            v_radius = vl.get(1);
+        } else {
+            h_radius = v_radius = value;
+        }
     }
 
 }

--- CssBorderBottomLeftFitLength.java DELETED ---

--- CssBorderCornerImage.java DELETED ---

Index: CssBorderBottomLeftRadius.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBorderBottomLeftRadius.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBorderBottomLeftRadius.java	5 Jan 2010 13:49:49 -0000	1.4
+++ CssBorderBottomLeftRadius.java	25 Apr 2012 20:22:04 -0000	1.5
@@ -1,171 +1,49 @@
-//
 // $Id$
-// From Sijtsche de Jong (http://www.w3.org/Consortium/Legal/copyright-software-19980720
 
 package org.w3c.css.properties.css3;
 
-import org.w3c.css.parser.CssStyle;
-import org.w3c.css.properties.css.CssProperty;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
-import org.w3c.css.values.CssNumber;
-import org.w3c.css.values.CssOperator;
 import org.w3c.css.values.CssTypes;
-import org.w3c.css.values.CssValue;
-
-public class CssBorderBottomLeftRadius extends CssProperty {
+import org.w3c.css.values.CssValueList;
 
-    String value;
-    ApplContext ac;
+public class CssBorderBottomLeftRadius extends org.w3c.css.properties.css.CssBorderBottomLeftRadius {
 
-    private static final String defaultValue;
-    private final static String propertyName = "border-bottom-left-radius";
-    
-    static {
-	defaultValue = (new CssNumber((float) 1.0)).toString();
-    }
-    
     /**
      * Create new CssBorderBottomLeftRadius
      */
     public CssBorderBottomLeftRadius() {
-	value = defaultValue;
+        value = initial;
     }
 
     /**
      * Create new CssBorderBottomLeftRadius
      *
      * @param expression The expression for this property
-     * @exception InvalidParamException Values are incorrect
+     * @throws InvalidParamException Values are incorrect
      */
     public CssBorderBottomLeftRadius(ApplContext ac, CssExpression expression,
-	    boolean check) throws InvalidParamException {
-	setByUser();
-	CssValue val = expression.getValue();
-	char op = expression.getOperator();
-	StringBuilder sb = new StringBuilder();
-
-	if (op != CssOperator.SPACE) {
-	    throw new InvalidParamException("operator", Character.toString(op),
-					    ac);
-	}
-	switch (val.getType()) {
-	case CssTypes.CSS_NUMBER:
-	    val = ((CssNumber)val).getLength();
-	case CssTypes.CSS_LENGTH:
-	    sb.append(val.toString());
-	    
-	    expression.next();
-	    val = expression.getValue();
-	    op = expression.getOperator();
-	    if (val != null) {
-		if (op != CssOperator.SPACE) {
-		    throw new InvalidParamException("operator", 
-						    Character.toString(op),
-						    ac);
-		}
-		switch (val.getType()) {
-		case CssTypes.CSS_NUMBER:
-		    val = ((CssNumber)val).getLength();
-		case CssTypes.CSS_LENGTH:
-		    sb.append(' ').append(val.toString());
-		    expression.next();
-		    break;
-		default:
-		    throw new InvalidParamException("value", 
-						    val,
-						    getPropertyName(), ac);
-		}
-	    }
-	    value = sb.toString();
-	    break;
-	default:
-	    throw new InvalidParamException("value", 
-					    val,
-					    getPropertyName(), ac);
-	}
+                                     boolean check) throws InvalidParamException {
+        setByUser();
+        value = CssBorderRadius.checkBorderCornerRadius(ac, this, expression, check);
+        if (value.getType() == CssTypes.CSS_VALUE_LIST) {
+            CssValueList vl = (CssValueList) value;
+            h_radius = vl.get(0);
+            v_radius = vl.get(1);
+        } else {
+            h_radius = v_radius = value;
+        }
     }
 
     public CssBorderBottomLeftRadius(ApplContext ac, CssExpression expression)
-	    throws InvalidParamException {
-	this(ac, expression, false);
-    }
-
-    /**
-     * Add this property to the CssStyle.
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	if (((Css3Style) style).cssBorderBottomLeftRadius != null)
-	    style.addRedefinitionWarning(ac, this);
-	((Css3Style) style).cssBorderBottomLeftRadius = 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 ((Css3Style) style).getBorderBottomLeftRadius();
-	} else {
-	    return ((Css3Style) style).cssBorderBottomLeftRadius;
-	}
-    }
-
-    /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
-     */
-    public boolean equals(CssProperty property) {
-	return (property instanceof CssBorderBottomLeftRadius &&
-		value.equals( ((CssBorderBottomLeftRadius) property).value));
-    }
-
-    /**
-     * Returns the name of this property
-     */
-    public final String getPropertyName() {
-	return propertyName;
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return value;
-    }
-
-    /**
-     * Returns true if this property is "softly" inherited
-     */
-    public boolean isSoftlyInherited() {
-	return value.equals(inherit);
-    }
-
-    /**
-     * Returns a string representation of the object
-     */
-    public String toString() {
-	return value;
+            throws InvalidParamException {
+        this(ac, expression, false);
     }
 
-    /**
-     * Is the value of this property a default value
-     * It is used by all macro for the function <code>print</code>
-     */
-    public boolean isDefault() {
-	return (defaultValue == value);
-
-    }
 
 }

--- NEW FILE: CssBorderBottom.java ---
// $Id: CssBorderBottom.java,v 1.1 2012/04/25 20:22:03 ylafon Exp $
// From Philippe Le Hegaret (http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#value-def-border-width
 * @version $Revision: 1.1 $
 */
public class CssBorderRightWidth extends org.w3c.css.properties.css.CssBorderRightWidth {

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

    /**
     * Creates a new CssBorderRightWidth
     *
     * @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 {
        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);
    }

}


--- NEW FILE: CssBorderWidth.java ---
// $Id: CssBorderWidth.java,v 1.1 2012/04/25 20:22:07 ylafon Exp $
// @author Yves Lafon <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 {

    public static CssIdent allowed_values[];

    static {
        allowed_values = new CssIdent[3];
        allowed_values[0] = CssIdent.getIdent("thin");
        allowed_values[1] = CssIdent.getIdent("medium");
        allowed_values[2] = CssIdent.getIdent("thick");
    }

    /*
     * Get the cached ident if it matches null otherwise
     */
    static CssIdent getMatchingIdent(CssIdent ident) {
        for (CssIdent id : allowed_values) {
            if (id.equals(ident)) {
                return id;
            }
        }
        return null;
    }

    /**
     * Create a new CssBorderWidth
     */
    public CssBorderWidth() {
        value = initial;
        top = new CssBorderTopWidth();
        right = new CssBorderRightWidth();
        bottom = new CssBorderBottomWidth();
        left = new CssBorderLeftWidth();
    }

    /**
     * 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 CssBorderWidth(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * 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 CssBorderWidth(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
        if (check && expression.getCount() > 4) {
            throw new InvalidParamException("unrecognize", ac);
        }
        setByUser();
        CssValue val;
        char op;

        ArrayList<CssValue> res = new ArrayList<CssValue>();
        while (res.size() < 4 && !expression.end()) {
            val = expression.getValue();
            op = expression.getOperator();

            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);

        // now assign the computed values...
        top = new CssBorderTopWidth();
        right = new CssBorderRightWidth();
        bottom = new CssBorderBottomWidth();
        left = new CssBorderLeftWidth();

        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);
        }
        shorthand = true;
    }


    /**
     * 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.
     */
    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;
    }
}

--- CssBorderRightImage.java DELETED ---

--- NEW FILE: CssBorderBottomStyle.java ---
// $Id: CssBorderBottomStyle.java,v 1.1 2012/04/25 20:22:04 ylafon Exp $
// Author: Yves Lafon <http://www.w3.org/TR/2012/CR-css3-background-20120417/#the-border-image-repeat
 */
public class CssBorderImageRepeat extends org.w3c.css.properties.css.CssBorderImageRepeat {

    public static final CssIdent allowed_values[];

    // stretch | repeat | round | space
    static {
        allowed_values = new CssIdent[4];
        allowed_values[0] = CssIdent.getIdent("stretch");
        allowed_values[1] = CssIdent.getIdent("repeat");
        allowed_values[2] = CssIdent.getIdent("round");
        allowed_values[3] = CssIdent.getIdent("space");
    }

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

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

    /**
     * Creates a new CssBorderImageWidth
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderImageRepeat(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {

        CssValueList valueList = new CssValueList();
        if (check && expression.getCount() > 2) {
            throw new InvalidParamException("unrecognize", ac);
        }
        CssValue val;
        char op;

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

            switch (val.getType()) {
                case CssTypes.CSS_IDENT:
                    if (inherit.equals(val)) {
                        if (expression.getCount() > 1) {
                            throw new InvalidParamException("unrecognize", ac);
                        }
                        valueList.add(inherit);
                        break;
                    }
                    CssIdent id = getMatchingIdent((CssIdent) val);
                    if (id != null) {
                        valueList.add(id);
                        break;
                    }
                    // unrecognized ident, let it fail
                default:
                    throw new InvalidParamException("value", val.toString(),
                            getPropertyName(), ac);
            }
            expression.next();
            if (op != SPACE) {
                throw new InvalidParamException("operator",
                        Character.toString(op),
                        ac);
            }
        }
        value = (valueList.size() == 1) ? valueList.get(0) : valueList;
    }

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


--- NEW FILE: CssBorderTop.java ---
// $Id: CssBorderTop.java,v 1.1 2012/04/25 20:22:06 ylafon Exp $
// From Philippe Le Hegaret (
Received on Wednesday, 25 April 2012 20:22:19 UTC

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