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

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 <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @spec 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 <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.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.CssTypes;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

import java.util.ArrayList;

import static org.w3c.css.values.CssOperator.SPACE;

/**
 * @spec 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 <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

import static org.w3c.css.values.CssOperator.SPACE;

/**
 * @version $Revision: 1.1 $
 * @spec 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 (sy.de.jong@let.rug.nl)
 //
-// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
+// (c) COPYRIGHT 1995-2012  World Wide Web Consortium (MIT, ERCIM, Keio University)
 // Please first read the full copyright statement at
 // 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 <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @spec 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 (sy.de.jong@let.rug.nl)
 //
-// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
+// (c) COPYRIGHT 1995-2012  World Wide Web Consortium (MIT, ERCIM, Keio University)
 // Please first read the full copyright statement at
 // 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 (sy.de.jong@let.rug.nl)
 //
-// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
+// (c) COPYRIGHT 1995-2012  World Wide Web Consortium (MIT, ERCIM, Keio University)
 // Please first read the full copyright statement at
 // 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 <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

import static org.w3c.css.values.CssOperator.SPACE;

/**
 * @version $Revision: 1.1 $
 * @spec 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 <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValueList;

/**
 * @since CSS1
 */
public class CssBorderLeft extends org.w3c.css.properties.css.CssBorderLeft {


    /**
     * Create a new CssBorderLeft
     */
    public CssBorderLeft() {
        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 CssBorderLeft(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 CssBorderLeft(ApplContext ac, CssExpression expression,
                         boolean check) throws InvalidParamException {
        CssBorder.SideValues values = CssBorder.checkBorderSide(ac, this, expression, check);
        CssValueList vl = new CssValueList();

        if (values.width != null) {
            _width = new CssBorderLeftWidth();
            _width.setByUser();
            _width.value = values.width;
            vl.add(values.width);
        }
        if (values.style != null) {
            _style = new CssBorderLeftStyle();
            _style.setByUser();
            _style.value = values.style;
            vl.add(values.style);
        }
        if (values.color != null) {
            _color = new CssBorderLeftColor();
            _color.setByUser();
            _color.value = values.color;
            vl.add(values.color);
        }
        if (inherit.equals(vl.get(0))) {
            value = inherit;
        } else {
            value = (vl.size() == 1) ? vl.get(0) : vl;
        }
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
        if (_width != null) {
            if (inherit == _width.value) {
                return inherit.toString();
            }
            if (initial == _width.value) {
                return initial.toString();
            }
        }
        StringBuilder sb = new StringBuilder();
        boolean first = true;
        if (_width != null) {
            sb.append(_width);
            first = false;
        }
        if (_style != null) {
            if (first) {
                sb.append(_style);
            } else {
                sb.append(' ').append(_style);
            }
            first = false;
        }
        if (_color != null) {
            if (first) {
                sb.append(_color);
            } else {
                sb.append(' ').append(_color);
            }
        }
        return sb.toString();
    }
}

--- CssBorderLeftFitWidth.java DELETED ---

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- Css3Style.java	5 Apr 2012 09:42:20 -0000	1.18
+++ Css3Style.java	25 Apr 2012 20:22:03 -0000	1.19
@@ -13,6 +13,8 @@
 import org.w3c.css.properties.css.CssBackgroundClip;
 import org.w3c.css.properties.css.CssBackgroundOrigin;
 import org.w3c.css.properties.css.CssBackgroundSize;
+import org.w3c.css.properties.css.CssBoxDecorationBreak;
+import org.w3c.css.properties.css.CssBoxShadow;
 import org.w3c.css.properties.css.CssBreakAfter;
 import org.w3c.css.properties.css.CssBreakBefore;
 import org.w3c.css.properties.css.CssBreakInside;
@@ -27,8 +29,6 @@
 import org.w3c.css.properties.css.CssColumnWidth;
 import org.w3c.css.properties.css.CssColumns;
 import org.w3c.css.properties.css.CssOpacity;
-import org.w3c.css.properties.css.CssBoxShadow;
-import org.w3c.css.properties.css.CssBoxDecorationBreak;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.Util;
 import org.w3c.css.util.Warning;
@@ -193,46 +193,19 @@
     CssMarqueeRepetition cssMarqueeRepetition;
     CssMarqueeSpeed cssMarqueeSpeed;
     CssMarqueeStyle cssMarqueeStyle;
-    CssBorderTopRightRadius cssBorderTopRightRadius;
-    CssBorderBottomRightRadius cssBorderBottomRightRadius;
-    CssBorderBottomLeftRadius cssBorderBottomLeftRadius;
-    CssBorderTopLeftRadius cssBorderTopLeftRadius;
-    CssBorderRadius cssBorderRadius;
-    CssBorderTopImage cssBorderTopImage;
-    CssBorderBottomImage cssBorderBottomImage;
-    CssBorderLeftImage cssBorderLeftImage;
-    CssBorderRightImage cssBorderRightImage;
-    CssBorderImage cssBorderImage;
-    CssBorderTopLeftImage cssBorderTopLeftImage;
-    CssBorderTopRightImage cssBorderTopRightImage;
-    CssBorderBottomLeftImage cssBorderBottomLeftImage;
-    CssBorderBottomRightImage cssBorderBottomRightImage;
-    CssBorderCornerImage cssBorderCornerImage;
-    CssBorderTopFitLength cssBorderTopFitLength;
-    CssBorderBottomFitLength cssBorderBottomFitLength;
-    CssBorderLeftFitLength cssBorderLeftFitLength;
-    CssBorderRightFitLength cssBorderRightFitLength;
-    CssBorderTopFitWidth cssBorderTopFitWidth;
-    CssBorderBottomFitWidth cssBorderBottomFitWidth;
-    CssBorderLeftFitWidth cssBorderLeftFitWidth;
-    CssBorderRightFitWidth cssBorderRightFitWidth;
-    CssBorderTopLeftFitLength cssBorderTopLeftFitLength;
-    CssBorderTopRightFitLength cssBorderTopRightFitLength;
-    CssBorderBottomRightFitLength cssBorderBottomRightFitLength;
-    CssBorderBottomLeftFitLength cssBorderBottomLeftFitLength;
-    CssBorderTopLeftFitWidth cssBorderTopLeftFitWidth;
-    CssBorderTopRightFitWidth cssBorderTopRightFitWidth;
-    CssBorderBottomLeftFitWidth cssBorderBottomLeftFitWidth;
-    CssBorderBottomRightFitWidth cssBorderBottomRightFitWidth;
-    CssBorderFitLength cssBorderFitLength;
-    CssBorderFitWidth cssBorderFitWidth;
-    CssBorderFit cssBorderFit;
-    CssBorderCornerFit cssBorderCornerFit;
-    CssBorderImageTransform cssBorderImageTransform;
-    CssBorderBreak cssBorderBreak;
+
+
     CssTextIndentCSS3 cssTextIndentCSS3;
     CssBlockProgression cssBlockProgression;
 
+
+    public org.w3c.css.properties.css.CssBorderImageSource getBorderImageSource() {
+        if (cssBorder.borderImage.source == null) {
+            cssBorder.borderImage.source = (org.w3c.css.properties.css.CssBorderImageSource) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderImageSource(), style, selector);
+        }
+        return cssBorder.borderImage.source;
+
+    }
     public CssOpacity getOpacity() {
         if (cssOpacity == null) {
             cssOpacity =
@@ -1583,337 +1556,49 @@
         return cssMarqueeStyle;
     }
 
-    public CssBorderTopRightRadius getBorderTopRightRadius() {
-        if (cssBorderTopRightRadius == null) {
-            cssBorderTopRightRadius =
-                    (CssBorderTopRightRadius) style.CascadingOrder(
+    public org.w3c.css.properties.css.CssBorderTopRightRadius getBorderTopRightRadius() {
+        if (cssBorder.borderRadius.topRight == null) {
+            cssBorder.borderRadius.topRight =
+                    (org.w3c.css.properties.css.CssBorderTopRightRadius) style.CascadingOrder(
                             new CssBorderTopRightRadius(), style, selector);
         }
-        return cssBorderTopRightRadius;
+        return cssBorder.borderRadius.topRight;
     }
 
-    public CssBorderBottomRightRadius getBorderBottomRightRadius() {
-        if (cssBorderBottomRightRadius == null) {
-            cssBorderBottomRightRadius =
-                    (CssBorderBottomRightRadius) style.CascadingOrder(
+    public org.w3c.css.properties.css.CssBorderBottomRightRadius getBorderBottomRightRadius() {
+        if (cssBorder.borderRadius.bottomRight == null) {
+            cssBorder.borderRadius.bottomRight =
+                    (org.w3c.css.properties.css.CssBorderBottomRightRadius) style.CascadingOrder(
                             new CssBorderBottomRightRadius(), style, selector);
         }
-        return cssBorderBottomRightRadius;
-    }
-
-    public CssBorderBottomLeftRadius getBorderBottomLeftRadius() {
-        if (cssBorderBottomLeftRadius == null) {
-            cssBorderBottomLeftRadius =
-                    (CssBorderBottomLeftRadius) style.CascadingOrder(
-                            new CssBorderBottomLeftRadius(), style, selector);
-        }
-        return cssBorderBottomLeftRadius;
-    }
-
-    public CssBorderTopLeftRadius getBorderTopLeftRadius() {
-        if (cssBorderTopLeftRadius == null) {
-            cssBorderTopLeftRadius =
-                    (CssBorderTopLeftRadius) style.CascadingOrder(
-                            new CssBorderTopLeftRadius(), style, selector);
-        }
-        return cssBorderTopLeftRadius;
-    }
-
-    public CssBorderRadius getBorderRadius() {
-        if (cssBorderRadius == null) {
-            cssBorderRadius =
-                    (CssBorderRadius) style.CascadingOrder(
-                            new CssBorderRadius(), style, selector);
-        }
-        return cssBorderRadius;
-    }
-
-    public CssBorderTopImage getBorderTopImage() {
-        if (cssBorderTopImage == null) {
-            cssBorderTopImage =
-                    (CssBorderTopImage) style.CascadingOrder(
-                            new CssBorderTopImage(), style, selector);
-        }
-        return cssBorderTopImage;
-    }
-
-    public CssBorderBottomImage getBorderBottomImage() {
-        if (cssBorderBottomImage == null) {
-            cssBorderBottomImage =
-                    (CssBorderBottomImage) style.CascadingOrder(
-                            new CssBorderBottomImage(), style, selector);
-        }
-        return cssBorderBottomImage;
-    }
-
-    public CssBorderLeftImage getBorderLeftImage() {
-        if (cssBorderLeftImage == null) {
-            cssBorderLeftImage =
-                    (CssBorderLeftImage) style.CascadingOrder(
-                            new CssBorderLeftImage(), style, selector);
-        }
-        return cssBorderLeftImage;
-    }
-
-    public CssBorderRightImage getBorderRightImage() {
-        if (cssBorderRightImage == null) {
-            cssBorderRightImage =
-                    (CssBorderRightImage) style.CascadingOrder(
-                            new CssBorderRightImage(), style, selector);
-        }
-        return cssBorderRightImage;
-    }
-
-    public CssBorderImage getBorderImage() {
-        if (cssBorderImage == null) {
-            cssBorderImage =
-                    (CssBorderImage) style.CascadingOrder(
-                            new CssBorderImage(), style, selector);
-        }
-        return cssBorderImage;
-    }
-
-    public CssBorderTopLeftImage getBorderTopLeftImage() {
-        if (cssBorderTopLeftImage == null) {
-            cssBorderTopLeftImage =
-                    (CssBorderTopLeftImage) style.CascadingOrder(
-                            new CssBorderTopLeftImage(), style, selector);
-        }
-        return cssBorderTopLeftImage;
-    }
-
-    public CssBorderTopRightImage getBorderTopRightImage() {
-        if (cssBorderTopRightImage == null) {
-            cssBorderTopRightImage =
-                    (CssBorderTopRightImage) style.CascadingOrder(
-                            new CssBorderTopRightImage(), style, selector);
-        }
-        return cssBorderTopRightImage;
-    }
-
-    public CssBorderBottomLeftImage getBorderBottomLeftImage() {
-        if (cssBorderBottomLeftImage == null) {
-            cssBorderBottomLeftImage =
-                    (CssBorderBottomLeftImage) style.CascadingOrder(
-                            new CssBorderBottomLeftImage(), style, selector);
-        }
-        return cssBorderBottomLeftImage;
-    }
-
-    public CssBorderBottomRightImage getBorderBottomRightImage() {
-        if (cssBorderBottomRightImage == null) {
-            cssBorderBottomRightImage =
-                    (CssBorderBottomRightImage) style.CascadingOrder(
-                            new CssBorderBottomRightImage(), style, selector);
-        }
-        return cssBorderBottomRightImage;
-    }
-
-    public CssBorderCornerImage getBorderCornerImage() {
-        if (cssBorderCornerImage == null) {
-            cssBorderCornerImage =
-                    (CssBorderCornerImage) style.CascadingOrder(
-                            new CssBorderCornerImage(), style, selector);
-        }
-        return cssBorderCornerImage;
-    }
-
-    public CssBorderTopFitLength getBorderTopFitLength() {
-        if (cssBorderTopFitLength == null) {
-            cssBorderTopFitLength =
-                    (CssBorderTopFitLength) style.CascadingOrder(
-                            new CssBorderTopFitLength(), style, selector);
-        }
-        return cssBorderTopFitLength;
-    }
-
-    public CssBorderBottomFitLength getBorderBottomFitLength() {
-        if (cssBorderBottomFitLength == null) {
-            cssBorderBottomFitLength =
-                    (CssBorderBottomFitLength) style.CascadingOrder(
-                            new CssBorderBottomFitLength(), style, selector);
-        }
-        return cssBorderBottomFitLength;
-    }
-
-    public CssBorderLeftFitLength getBorderLeftFitLength() {
-        if (cssBorderLeftFitLength == null) {
-            cssBorderLeftFitLength =
-                    (CssBorderLeftFitLength) style.CascadingOrder(
-                            new CssBorderLeftFitLength(), style, selector);
-        }
-        return cssBorderLeftFitLength;
-    }
-
-    public CssBorderRightFitLength getBorderRightFitLength() {
-        if (cssBorderRightFitLength == null) {
-            cssBorderRightFitLength =
-                    (CssBorderRightFitLength) style.CascadingOrder(
-                            new CssBorderRightFitLength(), style, selector);
-        }
-        return cssBorderRightFitLength;
-    }
-
-    public CssBorderTopFitWidth getBorderTopFitWidth() {
-        if (cssBorderTopFitWidth == null) {
-            cssBorderTopFitWidth =
-                    (CssBorderTopFitWidth) style.CascadingOrder(
-                            new CssBorderTopFitWidth(), style, selector);
-        }
-        return cssBorderTopFitWidth;
-    }
-
-    public CssBorderBottomFitWidth getBorderBottomFitWidth() {
-        if (cssBorderBottomFitWidth == null) {
-            cssBorderBottomFitWidth =
-                    (CssBorderBottomFitWidth) style.CascadingOrder(
-                            new CssBorderBottomFitWidth(), style, selector);
-        }
-        return cssBorderBottomFitWidth;
-    }
-
-    public CssBorderLeftFitWidth getBorderLeftFitWidth() {
-        if (cssBorderLeftFitWidth == null) {
-            cssBorderLeftFitWidth =
-                    (CssBorderLeftFitWidth) style.CascadingOrder(
-                            new CssBorderLeftFitWidth(), style, selector);
-        }
-        return cssBorderLeftFitWidth;
-    }
-
-    public CssBorderRightFitWidth getBorderRightFitWidth() {
-        if (cssBorderRightFitWidth == null) {
-            cssBorderRightFitWidth =
-                    (CssBorderRightFitWidth) style.CascadingOrder(
-                            new CssBorderRightFitWidth(), style, selector);
-        }
-        return cssBorderRightFitWidth;
-    }
-
-    public CssBorderTopLeftFitLength getBorderTopLeftFitLength() {
-        if (cssBorderTopLeftFitLength == null) {
-            cssBorderTopLeftFitLength =
-                    (CssBorderTopLeftFitLength) style.CascadingOrder(
-                            new CssBorderTopLeftFitLength(), style, selector);
-        }
-        return cssBorderTopLeftFitLength;
-    }
-
-    public CssBorderTopRightFitLength getBorderTopRightFitLength() {
-        if (cssBorderTopRightFitLength == null) {
-            cssBorderTopRightFitLength =
-                    (CssBorderTopRightFitLength) style.CascadingOrder(
-                            new CssBorderTopRightFitLength(), style, selector);
-        }
-        return cssBorderTopRightFitLength;
-    }
-
-    public CssBorderBottomLeftFitLength getBorderBottomLeftFitLength() {
-        if (cssBorderBottomLeftFitLength == null) {
-            cssBorderBottomLeftFitLength =
-                    (CssBorderBottomLeftFitLength) style.CascadingOrder(
-                            new CssBorderBottomLeftFitLength(), style, selector);
-        }
-        return cssBorderBottomLeftFitLength;
-    }
-
-    public CssBorderBottomRightFitLength getBorderBottomRightFitLength() {
-        if (cssBorderBottomRightFitLength == null) {
-            cssBorderBottomRightFitLength =
-                    (CssBorderBottomRightFitLength) style.CascadingOrder(
-                            new CssBorderBottomRightFitLength(), style, selector);
-        }
-        return cssBorderBottomRightFitLength;
-    }
-
-    public CssBorderTopLeftFitWidth getBorderTopLeftFitWidth() {
-        if (cssBorderTopLeftFitWidth == null) {
-            cssBorderTopLeftFitWidth =
-                    (CssBorderTopLeftFitWidth) style.CascadingOrder(
-                            new CssBorderTopLeftFitWidth(), style, selector);
-        }
-        return cssBorderTopLeftFitWidth;
-    }
-
-    public CssBorderTopRightFitWidth getBorderTopRightFitWidth() {
-        if (cssBorderTopRightFitWidth == null) {
-            cssBorderTopRightFitWidth =
-                    (CssBorderTopRightFitWidth) style.CascadingOrder(
-                            new CssBorderTopRightFitWidth(), style, selector);
-        }
-        return cssBorderTopRightFitWidth;
-    }
-
-    public CssBorderBottomLeftFitWidth getBorderBottomLeftFitWidth() {
-        if (cssBorderBottomLeftFitWidth == null) {
-            cssBorderBottomLeftFitWidth =
-                    (CssBorderBottomLeftFitWidth) style.CascadingOrder(
-                            new CssBorderBottomLeftFitWidth(), style, selector);
-        }
-        return cssBorderBottomLeftFitWidth;
-    }
-
-    public CssBorderBottomRightFitWidth getBorderBottomRightFitWidth() {
-        if (cssBorderBottomRightFitWidth == null) {
-            cssBorderBottomRightFitWidth =
-                    (CssBorderBottomRightFitWidth) style.CascadingOrder(
-                            new CssBorderBottomRightFitWidth(), style, selector);
-        }
-        return cssBorderBottomRightFitWidth;
-    }
-
-    public CssBorderFitLength getBorderFitLength() {
-        if (cssBorderFitLength == null) {
-            cssBorderFitLength =
-                    (CssBorderFitLength) style.CascadingOrder(
-                            new CssBorderFitLength(), style, selector);
-        }
-        return cssBorderFitLength;
-    }
-
-    public CssBorderFitWidth getBorderFitWidth() {
-        if (cssBorderFitWidth == null) {
-            cssBorderFitWidth =
-                    (CssBorderFitWidth) style.CascadingOrder(
-                            new CssBorderFitWidth(), style, selector);
-        }
-        return cssBorderFitWidth;
-    }
-
-    public CssBorderFit getBorderFit() {
-        if (cssBorderFit == null) {
-            cssBorderFit =
-                    (CssBorderFit) style.CascadingOrder(
-                            new CssBorderFit(), style, selector);
-        }
-        return cssBorderFit;
+        return cssBorder.borderRadius.bottomRight;
     }
 
-    public CssBorderCornerFit getBorderCornerFit() {
-        if (cssBorderCornerFit == null) {
-            cssBorderCornerFit =
-                    (CssBorderCornerFit) style.CascadingOrder(
-                            new CssBorderCornerFit(), style, selector);
+    public org.w3c.css.properties.css.CssBorderBottomLeftRadius getBorderBottomLeftRadius() {
+        if (cssBorder.borderRadius.bottomLeft == null) {
+            cssBorder.borderRadius.bottomLeft =
+                    (org.w3c.css.properties.css.CssBorderBottomLeftRadius) style.CascadingOrder(
+                            new org.w3c.css.properties.css.CssBorderBottomLeftRadius(), style, selector);
         }
-        return cssBorderCornerFit;
+        return cssBorder.borderRadius.bottomLeft;
     }
 
-    public CssBorderImageTransform getBorderImageTransform() {
-        if (cssBorderImageTransform == null) {
-            cssBorderImageTransform =
-                    (CssBorderImageTransform) style.CascadingOrder(
-                            new CssBorderImageTransform(), style, selector);
+    public org.w3c.css.properties.css.CssBorderTopLeftRadius getBorderTopLeftRadius() {
+        if (cssBorder.borderRadius.topLeft == null) {
+            cssBorder.borderRadius.topLeft =
+                    (org.w3c.css.properties.css.CssBorderTopLeftRadius) style.CascadingOrder(
+                            new org.w3c.css.properties.css.CssBorderTopLeftRadius(), style, selector);
         }
-        return cssBorderImageTransform;
+        return cssBorder.borderRadius.topLeft;
     }
 
-    public CssBorderBreak getBorderBreak() {
-        if (cssBorderBreak == null) {
-            cssBorderBreak =
-                    (CssBorderBreak) style.CascadingOrder(
-                            new CssBorderBreak(), style, selector);
+    public org.w3c.css.properties.css.CssBorderRadius getBorderRadius() {
+        if (cssBorder.borderRadius == null) {
+            cssBorder.borderRadius =
+                    (org.w3c.css.properties.css.CssBorderRadius) style.CascadingOrder(
+                            new org.w3c.css.properties.css.CssBorderRadius(), style, selector);
         }
-        return cssBorderBreak;
+        return cssBorder.borderRadius;
     }
 
     public CssBoxShadow getBoxShadow() {

--- NEW FILE: CssBorderImageWidth.java ---
// $Id: CssBorderImageWidth.java,v 1.1 2012/04/25 20:22:05 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

import static org.w3c.css.values.CssOperator.SPACE;

/**
 * @version $Revision: 1.1 $
 * @spec 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 <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.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.CssValue;
import org.w3c.css.values.CssValueList;

import java.util.ArrayList;

import static org.w3c.css.values.CssOperator.SPACE;

/**
 * @spec 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 <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderRightStyle extends org.w3c.css.properties.css.CssBorderRightStyle {

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

    /**
     * Creates a new CssBorderRightStyle
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderRightStyle(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        setByUser();
        // here we delegate to BorderWidth implementation
        value = CssBorderStyle.checkBorderSideStyle(ac, this, expression, check);
    }

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


--- CssBorderFitWidth.java DELETED ---

--- CssBorderTopRightImage.java DELETED ---

--- NEW FILE: CssBorderTopColor.java ---
// $Id: CssBorderTopColor.java,v 1.1 2012/04/25 20:22:06 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @see CssBorderColor
 * @version $Revision: 1.1 $
 */
public class CssBorderTopColor extends org.w3c.css.properties.css.CssBorderTopColor {

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

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

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


--- NEW FILE: CssBorderImageSource.java ---
// $Id: CssBorderImageSource.java,v 1.1 2012/04/25 20:22:05 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;

/**
 * @spec http://www.w3.org/TR/2012/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 (sy.de.jong@let.rug.nl)
 //
-// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
+// (c) COPYRIGHT 1995-2012  World Wide Web Consortium (MIT, ERCIM and Keio University)
 // Please first read the full copyright statement at
 // 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 <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @see CssBorderWidth
 * @version $Revision: 1.1 $
 */
public class CssBorderTopWidth extends org.w3c.css.properties.css.CssBorderTopWidth {

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

    /**
     * Creates a new CssBorderTopWidth
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderTopWidth(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        setByUser();
        // here we delegate to BorderWidth implementation
        value = CssBorderWidth.checkBorderSideWidth(ac, this, expression, check);
    }

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

}


--- CssBorderBottomRightFitWidth.java DELETED ---

Index: CssColor.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssColor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssColor.java	5 Oct 2011 07:12:17 -0000	1.2
+++ CssColor.java	25 Apr 2012 20:22:07 -0000	1.3
@@ -20,7 +20,6 @@
 public class CssColor extends org.w3c.css.properties.css.CssColor {
 
     CssValue color;
-    org.w3c.css.values.CssColor tempcolor = new org.w3c.css.values.CssColor();
     String attrvalue = null;
 
     /**
@@ -44,6 +43,8 @@
             throw new InvalidParamException("unrecognize", ac);
         }
 
+        org.w3c.css.values.CssColor tempcolor = new org.w3c.css.values.CssColor();
+
         CssValue val = expression.getValue();
         setByUser();
 

--- CssBorderBottomRightImage.java DELETED ---

--- NEW FILE: CssBorder.java ---
// $Id: CssBorder.java,v 1.1 2012/04/25 20:22:03 ylafon Exp $
// @author Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

import static org.w3c.css.values.CssOperator.SPACE;

/**
 * @spec 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 <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderLeftStyle extends org.w3c.css.properties.css.CssBorderLeftStyle {

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

    /**
     * Creates a new CssBorderLeftStyle
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderLeftStyle(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        setByUser();
        // here we delegate to BorderWidth implementation
        value = CssBorderStyle.checkBorderSideStyle(ac, this, expression, check);
    }

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


--- CssBorderTopFitLength.java DELETED ---

--- NEW FILE: CssBorderRight.java ---
// $Id: CssBorderRight.java,v 1.1 2012/04/25 20:22:06 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
// Rewritten 2010 Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio, 1997-2010.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @since CSS1
 */
public class CssBorderRight extends org.w3c.css.properties.css.CssBorderRight {

    /**
     * Create a new CssBorderRight
     */
    public CssBorderRight() {
        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 CssBorderRight(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 CssBorderRight(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
        CssBorder.SideValues values = CssBorder.checkBorderSide(ac, this, expression, check);
        if (values.width != null) {
            _width = new CssBorderRightWidth();
            _width.setByUser();
            _width.value = values.width;
        }
        if (values.style != null) {
            _style = new CssBorderRightStyle();
            _style.setByUser();
            _style.value = values.style;
        }
        if (values.color != null) {
            _color = new CssBorderRightColor();
            _color.setByUser();
            _color.value = values.color;
        }
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
        if (_width != null) {
            if (inherit == _width.value) {
                return inherit.toString();
            }
            if (initial == _width.value) {
                return initial.toString();
            }
        }
        StringBuilder sb = new StringBuilder();
        boolean first = true;
        if (_width != null) {
            sb.append(_width);
            first = false;
        }
        if (_style != null) {
            if (first) {
                sb.append(_style);
            } else {
                sb.append(' ').append(_style);
            }
            first = false;
        }
        if (_color != null) {
            if (first) {
                sb.append(_color);
            } else {
                sb.append(' ').append(_color);
            }
        }
        return sb.toString();
    }
}

--- NEW FILE: CssBorderTopStyle.java ---
// $Id: CssBorderTopStyle.java,v 1.1 2012/04/25 20:22:07 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @see CssBorderStyle
 * @version $Revision: 1.1 $
 */
public class CssBorderTopStyle extends org.w3c.css.properties.css.CssBorderTopStyle {

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

    /**
     * Creates a new CssBorderTopStyle
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderTopStyle(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        setByUser();
        // here we delegate to BorderWidth implementation
        value = CssBorderStyle.checkBorderSideStyle(ac, this, expression, check);
    }

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

}


--- NEW FILE: CssBorderBottomColor.java ---
// $Id: CssBorderBottomColor.java,v 1.1 2012/04/25 20:22:03 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderBottomColor extends org.w3c.css.properties.css.CssBorderBottomColor {

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

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

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


--- CssBorderFitLength.java DELETED ---

Index: CssBackgroundPosition.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBackgroundPosition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssBackgroundPosition.java	4 Oct 2011 13:05:25 -0000	1.1
+++ CssBackgroundPosition.java	25 Apr 2012 20:22:03 -0000	1.2
@@ -529,24 +529,22 @@
 
         public String toString() {
             StringBuilder sb = new StringBuilder();
-            if (horizontal != null) {
-                sb.append(horizontal);
-                if (horizontal_offset != null) {
-                    sb.append(' ').append(horizontal_offset);
-                }
-                if (vertical != null) {
-                    sb.append(' ');
-                }
-            }
             if (vertical != null) {
                 sb.append(vertical);
                 if (vertical_offset != null) {
                     sb.append(' ').append(vertical_offset);
                 }
+                if (horizontal != null) {
+                    sb.append(' ');
+                }
+            }
+            if (horizontal != null) {
+                sb.append(horizontal);
+                if (horizontal_offset != null) {
+                    sb.append(' ').append(horizontal_offset);
+                }
             }
             return sb.toString();
         }
-
     }
-
 }

Index: CssBorderTopRightRadius.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBorderTopRightRadius.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBorderTopRightRadius.java	5 Jan 2010 13:49:50 -0000	1.4
+++ CssBorderTopRightRadius.java	25 Apr 2012 20:22:07 -0000	1.5
@@ -1,40 +1,24 @@
-//
 // $Id$
-// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
 //
-// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
+// (c) COPYRIGHT 1995-2012  World Wide Web Consortium (MIT, ERCIM, Keio University)
 // Please first read the full copyright statement at
 // 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 (sy.de.jong@let.rug.nl)
 //
-// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
+// (c) COPYRIGHT 1995-2012  World Wide Web Consortium (MIT, ERCIM, Keio University)
 // Please first read the full copyright statement at
 // 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 (Philippe.Le_Hegaret@sophia.inria.fr)
// Rewritten 2010 Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio, 1997-2010.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @since CSS1
 */
public class CssBorderBottom extends org.w3c.css.properties.css.CssBorderBottom {

    /**
     * Create a new CssBorderBottom
     */
    public CssBorderBottom() {
        value = initial;
        _width = new CssBorderBottomWidth();
        _style = new CssBorderBottomStyle();
        _color = new CssBorderBottomColor();
    }

    /**
     * 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 CssBorderBottom(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 CssBorderBottom(ApplContext ac, CssExpression expression,
                           boolean check) throws InvalidParamException {
        CssBorder.SideValues values = CssBorder.checkBorderSide(ac, this, expression, check);
        if (values.width != null) {
            _width = new CssBorderBottomWidth();
            _width.setByUser();
            _width.value = values.width;
        }
        if (values.style != null) {
            _style = new CssBorderBottomStyle();
            _style.setByUser();
            _style.value = values.style;
        }
        if (values.color != null) {
            _color = new CssBorderBottomColor();
            _color.setByUser();
            _color.value = values.color;
        }
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
        if (_width != null) {
            if (inherit == _width.value) {
                return inherit.toString();
            }
            if (initial == _width.value) {
                return initial.toString();
            }
        }
        StringBuilder sb = new StringBuilder();
        boolean first = true;
        if (_width != null) {
            sb.append(_width);
            first = false;
        }
        if (_style != null) {
            if (first) {
                sb.append(_style);
            } else {
                sb.append(' ').append(_style);
            }
            first = false;
        }
        if (_color != null) {
            if (first) {
                sb.append(_color);
            } else {
                sb.append(' ').append(_color);
            }
        }
        return sb.toString();
    }
}

--- CssBorderBreak.java DELETED ---

--- NEW FILE: CssBorderRightColor.java ---
// $Id: CssBorderRightColor.java,v 1.1 2012/04/25 20:22:06 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderRightColor extends org.w3c.css.properties.css.CssBorderRightColor {

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

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

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


--- NEW FILE: CssBorderRightWidth.java ---
// $Id: CssBorderRightWidth.java,v 1.1 2012/04/25 20:22:06 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @spec 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 <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

import java.util.ArrayList;

import static org.w3c.css.values.CssOperator.SPACE;

/**
 * @spec 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 <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderBottomStyle extends org.w3c.css.properties.css.CssBorderBottomStyle {

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

    /**
     * Creates a new CssBorderBottomStyle
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderBottomStyle(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        setByUser();
        // here we delegate to BorderWidth implementation
        value = CssBorderStyle.checkBorderSideStyle(ac, this, expression, check);
    }

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


--- NEW FILE: CssBorderLeftColor.java ---
// $Id: CssBorderLeftColor.java,v 1.1 2012/04/25 20:22:05 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @see
 */
public class CssBorderLeftColor extends org.w3c.css.properties.css.CssBorderLeftColor {

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

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

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


--- NEW FILE: CssBorderImageRepeat.java ---
// $Id: CssBorderImageRepeat.java,v 1.1 2012/04/25 20:22:05 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

import static org.w3c.css.values.CssOperator.SPACE;

/**
 * @version $Revision: 1.1 $
 * @spec 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 (Philippe.Le_Hegaret@sophia.inria.fr)
// Rewritten 2010 Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio, 1997-2010.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 * @since CSS1
 */
public class CssBorderTop extends org.w3c.css.properties.css.CssBorderTop {

    /**
     * Create a new CssBorderTop
     */
    public CssBorderTop() {
        value = initial;
        _width = new CssBorderTopWidth();
        _style = new CssBorderTopStyle();
        _color = new CssBorderTopColor();
    }

    /**
     * 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 CssBorderTop(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 CssBorderTop(ApplContext ac, CssExpression expression,
                        boolean check) throws InvalidParamException {
        CssBorder.SideValues values = CssBorder.checkBorderSide(ac, this, expression, check);
        if (values.width != null) {
            _width = new CssBorderTopWidth();
            _width.setByUser();
            _width.value = values.width;
        }
        if (values.style != null) {
            _style = new CssBorderTopStyle();
            _style.setByUser();
            _style.value = values.style;
        }
        if (values.color != null) {
            _color = new CssBorderTopColor();
            _color.setByUser();
            _color.value = values.color;
        }
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
        if (_width != null) {
            if (inherit == _width.value) {
                return inherit.toString();
            }
            if (initial == _width.value) {
                return initial.toString();
            }
        }
        StringBuilder sb = new StringBuilder();
        boolean first = true;
        if (_width != null) {
            sb.append(_width);
            first = false;
        }
        if (_style != null) {
            if (first) {
                sb.append(_style);
            } else {
                sb.append(' ').append(_style);
            }
            first = false;
        }
        if (_color != null) {
            if (first) {
                sb.append(_color);
            } else {
                sb.append(' ').append(_color);
            }
        }
        return sb.toString();
    }

}

Received on Wednesday, 25 April 2012 20:22:19 UTC