2002/css-validator/org/w3c/css/properties/css1 CssBackgroundPositionCSS2.java,1.6,1.7 CssBorderColor.java,1.3,1.4 CssBorderColorCSS1.java,1.3,1.4 CssBorderColorCSS2.java,1.4,1.5 CssBorderFaceColorCSS2.java,1.4,1.5 CssBorderStyle.java,1.3,1.4 CssBorderStyleCSS1.java,1.3,1.4 CssBorderStyleCSS2.java,1.3,1.4 CssBorderWidthCSS1.java,1.3,1.4 CssBorderWidthCSS2.java,1.3,1.4 CssMargin.java,1.3,1.4 CssPadding.java,1.2,1.3

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

Modified Files:
	CssBackgroundPositionCSS2.java CssBorderColor.java 
	CssBorderColorCSS1.java CssBorderColorCSS2.java 
	CssBorderFaceColorCSS2.java CssBorderStyle.java 
	CssBorderStyleCSS1.java CssBorderStyleCSS2.java 
	CssBorderWidthCSS1.java CssBorderWidthCSS2.java CssMargin.java 
	CssPadding.java 
Log Message:
Jean-Gui strikes back!
http://www.w3.org/Bugs/Public/show_bug.cgi?id=2560 -> @media case insensitive
http://www.w3.org/Bugs/Public/show_bug.cgi?id=3037 -> grammar correction
http://www.w3.org/Bugs/Public/show_bug.cgi?id=2920
http://www.w3.org/Bugs/Public/show_bug.cgi?id=2800
http://www.w3.org/Bugs/Public/show_bug.cgi?id=233
http://www.w3.org/Bugs/Public/show_bug.cgi?id=2919
http://www.w3.org/Bugs/Public/show_bug.cgi?id=2446
http://www.w3.org/Bugs/Public/show_bug.cgi?id=3099

output parameter bug fixed:
        accepted values :
            * text/html and html
            * application/xhtml+xml and xhtml
            * application/soap+xml and soap12
            * everything else: text/plain

fixed a bug with SOAP output



Index: CssMargin.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssMargin.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssMargin.java	14 Sep 2005 15:14:31 -0000	1.3
+++ CssMargin.java	19 Apr 2006 11:28:05 -0000	1.4
@@ -93,9 +93,9 @@
 	switch (expression.getCount()) {
 	case 1:
 	    top = new CssMarginTop(ac, expression);
-	    bottom = new CssMarginBottom(top);
+	    /*bottom = new CssMarginBottom(top);
 	    right = new CssMarginRight(top);
-	    left = new CssMarginLeft(top);
+	    left = new CssMarginLeft(top);*/
 	    break;
 	case 2:
 	    if (expression.getOperator() != SPACE)
@@ -110,8 +110,8 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssMarginRight(ac, expression);
-	    bottom = new CssMarginBottom(top);
-	    left = new CssMarginLeft(right);
+	    /*bottom = new CssMarginBottom(top);
+	    left = new CssMarginLeft(right);*/
 	    break;
 	case 3:
 	    if (expression.getOperator() != SPACE)
@@ -134,7 +134,7 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    bottom = new CssMarginBottom(ac, expression);
-	    left = new CssMarginLeft(right);
+	    //left = new CssMarginLeft(right);
 	    break;
 	case 4:
 	    if (expression.getOperator() != SPACE)
@@ -226,7 +226,14 @@
 	if (inheritedValue) {
 	    return inherit.toString();
 	}
-	if (right.value.equals(left.value)) {
+        String result = "";
+        // top should never be null
+        if(top != null) result += top;
+        if(right != null) result += " " + right;
+        if(bottom != null) result += " " + bottom;
+        if(left != null) result += " " + left;
+        return result;
+	/*if (right.value.equals(left.value)) {
 	    if (top.value.equals(bottom.value)) {
 		if (top.value.equals(right.value)) {
 		    return top.toString();
@@ -238,7 +245,7 @@
 	    }
 	} else {
 	    return top + " " + right + " " + bottom + " " + left;
-	}
+	}*/
     }
 
     /**
@@ -282,7 +289,7 @@
 	    printer.print(this);
 	} else if ((top != null && right != null &&
 		    bottom != null && left != null) &&
-		   (getImportant() ||
+		    (getImportant() ||
 		    (!top.important &&
 		     !right.important &&
 		     !bottom.important &&
@@ -372,10 +379,10 @@
 	// always. What would be the cause of that, an invalid clause?
 	// in this case a proper exception should be sent
 	// So... a FIXME
-	top.setInfo(line, source);
-	right.setInfo(line, source);
-	bottom.setInfo(line, source);
-	left.setInfo(line, source);
+	if(top != null) top.setInfo(line, source);
+	if(right != null) right.setInfo(line, source);
+	if(bottom != null) bottom.setInfo(line, source);
+	if(left != null) left.setInfo(line, source);
     }
 
     /**

Index: CssBorderFaceColorCSS2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderFaceColorCSS2.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBorderFaceColorCSS2.java	14 Sep 2005 15:14:31 -0000	1.4
+++ CssBorderFaceColorCSS2.java	19 Apr 2006 11:28:05 -0000	1.5
@@ -63,6 +63,8 @@
 	    face = val;
 	} else if (val.equals(CssProperty.inherit)) {
 	    face = CssProperty.inherit;
+	} else if(val.equals(CssProperty.transparent)) {
+	    setFace(CssProperty.transparent);
 	} else if (val instanceof CssIdent) {
 	    face = new org.w3c.css.values.CssColorCSS2(ac, (String) val.get());
 	} else {

Index: CssBorderStyleCSS1.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderStyleCSS1.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssBorderStyleCSS1.java	14 Sep 2005 15:14:31 -0000	1.3
+++ CssBorderStyleCSS1.java	19 Apr 2006 11:28:05 -0000	1.4
@@ -121,9 +121,9 @@
 	switch (expression.getCount()) {
 	case 1:
 	    top = new CssBorderTopStyleCSS1(ac, expression);
-	    bottom = new CssBorderBottomStyleCSS1((CssBorderFaceStyleCSS1) top.get());
+	    /*bottom = new CssBorderBottomStyleCSS1((CssBorderFaceStyleCSS1) top.get());
 	    right = new CssBorderRightStyleCSS1((CssBorderFaceStyleCSS1) top.get());
-	    left = new CssBorderLeftStyleCSS1((CssBorderFaceStyleCSS1) top.get());
+	    left = new CssBorderLeftStyleCSS1((CssBorderFaceStyleCSS1) top.get());*/
 	    break;
 	case 2:
 	    if (expression.getOperator() != SPACE)
@@ -132,8 +132,8 @@
 			ac);
 	    top = new CssBorderTopStyleCSS1(ac, expression);
 	    right = new CssBorderRightStyleCSS1(ac, expression);
-	    bottom = new CssBorderBottomStyleCSS1((CssBorderFaceStyleCSS1) top.get());
-	    left = new CssBorderLeftStyleCSS1((CssBorderFaceStyleCSS1) right.get());
+	    /*bottom = new CssBorderBottomStyleCSS1((CssBorderFaceStyleCSS1) top.get());
+	    left = new CssBorderLeftStyleCSS1((CssBorderFaceStyleCSS1) right.get());*/
 	    break;
 	case 3:
 	    if (expression.getOperator() != SPACE)
@@ -147,7 +147,7 @@
 			ac);
 	    right = new CssBorderRightStyleCSS1(ac, expression);
 	    bottom = new CssBorderBottomStyleCSS1(ac, expression);
-	    left = new CssBorderLeftStyleCSS1((CssBorderFaceStyleCSS1) right.get());
+	    //left = new CssBorderLeftStyleCSS1((CssBorderFaceStyleCSS1) right.get());
 	    break;
 	case 4:
 	    if (expression.getOperator() != SPACE)
@@ -197,7 +197,14 @@
      * Returns a string representation of the object.
      */
     public String toString() {
-	if (right.face.equals(left.face)) {
+        String result = "";
+        // top should never be null
+        if(top != null) result += top;
+        if(right != null) result += " " + right;
+        if(bottom != null) result += " " + bottom;
+        if(left != null) result += " " + left;
+        return result;
+	/*if (right.face.equals(left.face)) {
 	    if (top.face.equals(bottom.face)) {
 		if (top.face.equals(right.face)) {
 		    return top.toString();
@@ -209,7 +216,7 @@
 	    }
 	} else {
 	    return top + " " + right + " " + bottom + " " + left;
-	}
+	}*/
     }
 
     /**

Index: CssBorderStyleCSS2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderStyleCSS2.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssBorderStyleCSS2.java	14 Sep 2005 15:14:31 -0000	1.3
+++ CssBorderStyleCSS2.java	19 Apr 2006 11:28:05 -0000	1.4
@@ -120,9 +120,9 @@
 	switch (expression.getCount()) {
 	case 1:
 	    top = new CssBorderTopStyleCSS2(ac, expression);
-	    bottom = new CssBorderBottomStyleCSS2((CssBorderFaceStyleCSS2) top.get());
+	    /*bottom = new CssBorderBottomStyleCSS2((CssBorderFaceStyleCSS2) top.get());
 	    right = new CssBorderRightStyleCSS2((CssBorderFaceStyleCSS2) top.get());
-	    left = new CssBorderLeftStyleCSS2((CssBorderFaceStyleCSS2) top.get());
+	    left = new CssBorderLeftStyleCSS2((CssBorderFaceStyleCSS2) top.get());*/
 	    break;
 	case 2:
 	    if (expression.getOperator() != SPACE)
@@ -137,8 +137,8 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssBorderRightStyleCSS2(ac, expression);
-	    bottom = new CssBorderBottomStyleCSS2((CssBorderFaceStyleCSS2) top.get());
-	    left = new CssBorderLeftStyleCSS2((CssBorderFaceStyleCSS2) right.get());
+	    /*bottom = new CssBorderBottomStyleCSS2((CssBorderFaceStyleCSS2) top.get());
+	    left = new CssBorderLeftStyleCSS2((CssBorderFaceStyleCSS2) right.get());*/
 	    break;
 	case 3:
 	    if (expression.getOperator() != SPACE)
@@ -161,7 +161,7 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    bottom = new CssBorderBottomStyleCSS2(ac, expression);
-	    left = new CssBorderLeftStyleCSS2((CssBorderFaceStyleCSS2) right.get());
+	    //left = new CssBorderLeftStyleCSS2((CssBorderFaceStyleCSS2) right.get());
 	    break;
 	case 4:
 	    if (expression.getOperator() != SPACE)
@@ -223,7 +223,14 @@
      * Returns a string representation of the object.
      */
     public String toString() {
-	if (right.face.equals(left.face)) {
+        String result = "";
+        // top should never be null
+        if(top != null) result += top;
+        if(right != null) result += " " + right;
+        if(bottom != null) result += " " + bottom;
+        if(left != null) result += " " + left;
+        return result;
+	/*if (right.face.equals(left.face)) {
 	    if (top.face.equals(bottom.face)) {
 		if (top.face.equals(right.face)) {
 		    return top.toString();
@@ -235,7 +242,7 @@
 	    }
 	} else {
 	    return top + " " + right + " " + bottom + " " + left;
-	}
+	}*/
     }
 
     /**

Index: CssBorderStyle.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderStyle.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssBorderStyle.java	14 Sep 2005 15:14:31 -0000	1.3
+++ CssBorderStyle.java	19 Apr 2006 11:28:05 -0000	1.4
@@ -120,9 +120,9 @@
 	switch (expression.getCount()) {
 	case 1:
 	    top = new CssBorderTopStyle(ac, expression);
-	    bottom = new CssBorderBottomStyle((CssBorderFaceStyle) top.get());
+	    /*bottom = new CssBorderBottomStyle((CssBorderFaceStyle) top.get());
 	    right = new CssBorderRightStyle((CssBorderFaceStyle) top.get());
-	    left = new CssBorderLeftStyle((CssBorderFaceStyle) top.get());
+	    left = new CssBorderLeftStyle((CssBorderFaceStyle) top.get());*/
 	    break;
 	case 2:
 	    if (expression.getOperator() != SPACE)
@@ -137,8 +137,8 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssBorderRightStyle(ac, expression);
-	    bottom = new CssBorderBottomStyle((CssBorderFaceStyle) top.get());
-	    left = new CssBorderLeftStyle((CssBorderFaceStyle) right.get());
+	    /*bottom = new CssBorderBottomStyle((CssBorderFaceStyle) top.get());
+	    left = new CssBorderLeftStyle((CssBorderFaceStyle) right.get());*/
 	    break;
 	case 3:
 	    if (expression.getOperator() != SPACE)
@@ -161,7 +161,7 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    bottom = new CssBorderBottomStyle(ac, expression);
-	    left = new CssBorderLeftStyle((CssBorderFaceStyle) right.get());
+	    //left = new CssBorderLeftStyle((CssBorderFaceStyle) right.get());
 	    break;
 	case 4:
 	    if (expression.getOperator() != SPACE) {
@@ -225,7 +225,14 @@
      * Returns a string representation of the object.
      */
     public String toString() {
-	if (right.face.equals(left.face)) {
+        String result = "";
+        // top should never be null
+        if(top != null) result += top;
+        if(right != null) result += " " + right;
+        if(bottom != null) result += " " + bottom;
+        if(left != null) result += " " + left;
+        return result;
+	/*if (right.face.equals(left.face)) {
 	    if (top.face.equals(bottom.face)) {
 		if (top.face.equals(right.face)) {
 		    return top.toString();
@@ -237,7 +244,7 @@
 	    }
 	} else {
 	    return top + " " + right + " " + bottom + " " + left;
-	}
+	}*/
     }
 
     /**

Index: CssBorderWidthCSS2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderWidthCSS2.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssBorderWidthCSS2.java	14 Sep 2005 15:14:31 -0000	1.3
+++ CssBorderWidthCSS2.java	19 Apr 2006 11:28:05 -0000	1.4
@@ -88,9 +88,9 @@
 	switch (expression.getCount()) {
 	case 1:
 	    top = new CssBorderTopWidthCSS2(ac, expression);
-	    bottom = new CssBorderBottomWidthCSS2((CssBorderFaceWidthCSS2) top.get());
+	    /*bottom = new CssBorderBottomWidthCSS2((CssBorderFaceWidthCSS2) top.get());
 	    right = new CssBorderRightWidthCSS2((CssBorderFaceWidthCSS2) top.get());
-	    left = new CssBorderLeftWidthCSS2((CssBorderFaceWidthCSS2) top.get());
+	    left = new CssBorderLeftWidthCSS2((CssBorderFaceWidthCSS2) top.get());*/
 	    break;
 	case 2:
 	    if (expression.getOperator() != SPACE)
@@ -105,8 +105,8 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssBorderRightWidthCSS2(ac, expression);
-	    bottom = new CssBorderBottomWidthCSS2((CssBorderFaceWidthCSS2) top.get());
-	    left = new CssBorderLeftWidthCSS2((CssBorderFaceWidthCSS2) right.get());
+	    /*bottom = new CssBorderBottomWidthCSS2((CssBorderFaceWidthCSS2) top.get());
+	    left = new CssBorderLeftWidthCSS2((CssBorderFaceWidthCSS2) right.get());*/
 	    break;
 	case 3:
 	    if (expression.getOperator() != SPACE)
@@ -129,7 +129,7 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    bottom = new CssBorderBottomWidthCSS2(ac, expression);
-	    left = new CssBorderLeftWidthCSS2((CssBorderFaceWidthCSS2) right.get());
+	    //left = new CssBorderLeftWidthCSS2((CssBorderFaceWidthCSS2) right.get());
 	    break;
 	case 4:
 	    if (expression.getOperator() != SPACE)
@@ -191,7 +191,14 @@
      * Returns a string representation of the object.
      */
     public String toString() {
-	if (right.face.equals(left.face)) {
+        String result = "";
+        // top should never be null
+        if(top != null) result += top;
+        if(right != null) result += " " + right;
+        if(bottom != null) result += " " + bottom;
+        if(left != null) result += " " + left;
+        return result;
+	/*if (right.face.equals(left.face)) {
 	    if (top.face.equals(bottom.face)) {
 		if (top.face.equals(right.face)) {
 		    return top.toString();
@@ -203,7 +210,7 @@
 	    }
 	} else {
 	    return top + " " + right + " " + bottom + " " + left;
-	}
+	}*/
     }
 
     /**

Index: CssBorderColor.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderColor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssBorderColor.java	14 Sep 2005 15:14:31 -0000	1.3
+++ CssBorderColor.java	19 Apr 2006 11:28:05 -0000	1.4
@@ -91,9 +91,9 @@
 		expression.next();
 	    } else*/
 	    top = new CssBorderTopColor(ac, expression);
-	    bottom = new CssBorderBottomColor((CssBorderFaceColor) top.get());
+	    /*bottom = new CssBorderBottomColor((CssBorderFaceColor) top.get());
 	    right = new CssBorderRightColor((CssBorderFaceColor) top.get());
-	    left = new CssBorderLeftColor((CssBorderFaceColor) top.get());
+	    left = new CssBorderLeftColor((CssBorderFaceColor) top.get());*/
 	    break;
 	case 2:
 	    if (expression.getOperator() != SPACE)
@@ -108,8 +108,8 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssBorderRightColor(ac, expression);
-	    bottom = new CssBorderBottomColor((CssBorderFaceColor) top.get());
-	    left = new CssBorderLeftColor((CssBorderFaceColor) right.get());
+	    /*bottom = new CssBorderBottomColor((CssBorderFaceColor) top.get());
+	    left = new CssBorderLeftColor((CssBorderFaceColor) right.get());*/
 	    break;
 	case 3:
 	    if (expression.getOperator() != SPACE)
@@ -131,7 +131,7 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    bottom = new CssBorderBottomColor(ac, expression);
-	    left = new CssBorderLeftColor((CssBorderFaceColor) right.get());
+	    //left = new CssBorderLeftColor((CssBorderFaceColor) right.get());
 	    break;
 	case 4:
 	    if (expression.getOperator() != SPACE)
@@ -194,7 +194,14 @@
      * Returns a string representation of the object.
      */
     public String toString() {
-	if (right.face.equals(left.face)) {
+        String result = "";
+        // top should never be null
+        if(top != null) result += top;
+        if(right != null) result += " " + right;
+        if(bottom != null) result += " " + bottom;
+        if(left != null) result += " " + left;
+        return result;
+	/*if (right.face.equals(left.face)) {
 	    if (top.face.equals(bottom.face)) {
 		if (top.face.equals(right.face)) {
 		    return top.toString();
@@ -206,7 +213,7 @@
 	    }
 	} else {
 	    return top + " " + right + " " + bottom + " " + left;
-	}
+	}*/
 
     }
 

Index: CssBorderColorCSS1.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderColorCSS1.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssBorderColorCSS1.java	14 Sep 2005 15:14:31 -0000	1.3
+++ CssBorderColorCSS1.java	19 Apr 2006 11:28:05 -0000	1.4
@@ -78,9 +78,9 @@
 	switch (expression.getCount()) {
 	case 1:
 	    top = new CssBorderTopColorCSS1(ac, expression);
-	    bottom = new CssBorderBottomColorCSS1((CssBorderFaceColorCSS1) top.get());
+	    /*bottom = new CssBorderBottomColorCSS1((CssBorderFaceColorCSS1) top.get());
 	    right = new CssBorderRightColorCSS1((CssBorderFaceColorCSS1) top.get());
-	    left = new CssBorderLeftColorCSS1((CssBorderFaceColorCSS1) top.get());
+	    left = new CssBorderLeftColorCSS1((CssBorderFaceColorCSS1) top.get());*/
 	    break;
 	case 2:
 	    if (expression.getOperator() != SPACE)
@@ -95,8 +95,8 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssBorderRightColorCSS1(ac, expression);
-	    bottom = new CssBorderBottomColorCSS1((CssBorderFaceColorCSS1) top.get());
-	    left = new CssBorderLeftColorCSS1((CssBorderFaceColorCSS1) right.get());
+	    /*bottom = new CssBorderBottomColorCSS1((CssBorderFaceColorCSS1) top.get());
+	    left = new CssBorderLeftColorCSS1((CssBorderFaceColorCSS1) right.get());*/
 	    break;
 	case 3:
 	    if (expression.getOperator() != SPACE)
@@ -118,7 +118,7 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    bottom = new CssBorderBottomColorCSS1(ac, expression);
-	    left = new CssBorderLeftColorCSS1((CssBorderFaceColorCSS1) right.get());
+	    //left = new CssBorderLeftColorCSS1((CssBorderFaceColorCSS1) right.get());
 	    break;
 	case 4:
 	    if (expression.getOperator() != SPACE)
@@ -183,18 +183,18 @@
     public String toString() {
 	String ret = "";
 	if(top != null) {
-	    ret += top + " ";
+	    ret += top;
 	}
 	if(right != null) {
-	    ret += right + " ";
+	    ret += " " + right;
 	}
 	if(bottom != null) {
-	    ret += bottom + " ";
+	    ret += " " + bottom;
 	}
 	if(left != null) {
-	    ret += left;
+	    ret += " " + left;
 	}
-	return ret.trim();
+	return ret;
 	/*
 	if (right.face.equals(left.face)) {
 	    if (top.face.equals(bottom.face)) {

Index: CssBorderWidthCSS1.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderWidthCSS1.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssBorderWidthCSS1.java	14 Sep 2005 15:14:31 -0000	1.3
+++ CssBorderWidthCSS1.java	19 Apr 2006 11:28:05 -0000	1.4
@@ -88,9 +88,9 @@
 	switch (expression.getCount()) {
 	case 1:
 	    top = new CssBorderTopWidthCSS1(ac, expression);
-	    bottom = new CssBorderBottomWidthCSS1((CssBorderFaceWidthCSS1) top.get());
+	    /*bottom = new CssBorderBottomWidthCSS1((CssBorderFaceWidthCSS1) top.get());
 	    right = new CssBorderRightWidthCSS1((CssBorderFaceWidthCSS1) top.get());
-	    left = new CssBorderLeftWidthCSS1((CssBorderFaceWidthCSS1) top.get());
+	    left = new CssBorderLeftWidthCSS1((CssBorderFaceWidthCSS1) top.get());*/
 	    break;
 	case 2:
 	    if (expression.getOperator() != SPACE)
@@ -105,8 +105,8 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssBorderRightWidthCSS1(ac, expression);
-	    bottom = new CssBorderBottomWidthCSS1((CssBorderFaceWidthCSS1) top.get());
-	    left = new CssBorderLeftWidthCSS1((CssBorderFaceWidthCSS1) right.get());
+	    /*bottom = new CssBorderBottomWidthCSS1((CssBorderFaceWidthCSS1) top.get());
+	    left = new CssBorderLeftWidthCSS1((CssBorderFaceWidthCSS1) right.get());*/
 	    break;
 	case 3:
 	    if (expression.getOperator() != SPACE)
@@ -129,7 +129,7 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    bottom = new CssBorderBottomWidthCSS1(ac, expression);
-	    left = new CssBorderLeftWidthCSS1((CssBorderFaceWidthCSS1) right.get());
+	    //left = new CssBorderLeftWidthCSS1((CssBorderFaceWidthCSS1) right.get());
 	    break;
 	case 4:
 	    if (expression.getOperator() != SPACE)
@@ -191,7 +191,14 @@
      * Returns a string representation of the object.
      */
     public String toString() {
-	if (right.face.equals(left.face)) {
+        String result = "";
+        // top should never be null
+        if(top != null) result += top;
+        if(right != null) result += " " + right;
+        if(bottom != null) result += " " + bottom;
+        if(left != null) result += " " + left;
+        return result;
+	/*if (right.face.equals(left.face)) {
 	    if (top.face.equals(bottom.face)) {
 		if (top.face.equals(right.face)) {
 		    return top.toString();
@@ -203,7 +210,7 @@
 	    }
 	} else {
 	    return top + " " + right + " " + bottom + " " + left;
-	}
+	}*/
     }
 
     /**

Index: CssBorderColorCSS2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderColorCSS2.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBorderColorCSS2.java	14 Sep 2005 15:14:31 -0000	1.4
+++ CssBorderColorCSS2.java	19 Apr 2006 11:28:05 -0000	1.5
@@ -84,8 +84,8 @@
 
 	switch (expression.getCount()) {
 	case 1:
-
-	    val = expression.getValue();
+	    setTop(new CssBorderTopColorCSS2(ac, expression));
+	   /* val = expression.getValue();
 	    if (val.equals(transparent)) {
 		top = new CssBorderTopColorCSS2();
 		top.face.face = transparent;
@@ -99,7 +99,7 @@
 //		bottom = new CssBorderBottomColorCSS2((CssBorderFaceColorCSS2) top.get());
 //		right = new CssBorderRightColorCSS2((CssBorderFaceColorCSS2) top.get());
 //		left = new CssBorderLeftColorCSS2((CssBorderFaceColorCSS2) top.get());
-	    }
+	    }*/
 	    break;
 	case 2:
 	    if (expression.getOperator() != SPACE)
@@ -107,12 +107,12 @@
 						((new Character(expression.getOperator())).toString()),
 						ac);
 	    val = expression.getValue();
-	    if(val.equals(inherit) || val.equals(transparent)) {
+	    if(val.equals(inherit)) {
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    top = new CssBorderTopColorCSS2(ac, expression);
 	    val = expression.getValue();
-	    if(val.equals(inherit) || val.equals(transparent)) {
+	    if(val.equals(inherit)) {
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssBorderRightColorCSS2(ac, expression);
@@ -125,7 +125,7 @@
 						((new Character(expression.getOperator())).toString()),
 						ac);
 	    val = expression.getValue();
-	    if(val.equals(inherit) || val.equals(transparent)) {
+	    if(val.equals(inherit)) {
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    top = new CssBorderTopColorCSS2(ac, expression);
@@ -133,12 +133,12 @@
 		throw new InvalidParamException("operator",
 						((new Character(expression.getOperator())).toString()), ac);
 	    val = expression.getValue();
-	    if(val.equals(inherit) || val.equals(transparent)) {
+	    if(val.equals(inherit)) {
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssBorderRightColorCSS2(ac, expression);
 	    val = expression.getValue();
-	    if(val.equals(inherit) || val.equals(transparent)) {
+	    if(val.equals(inherit)) {
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    bottom = new CssBorderBottomColorCSS2(ac, expression);
@@ -150,7 +150,7 @@
 						((new Character(expression.getOperator())).toString()),
 						ac);
 	    val = expression.getValue();
-	    if(val.equals(inherit) || val.equals(transparent)) {
+	    if(val.equals(inherit)) {
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    top = new CssBorderTopColorCSS2(ac, expression);
@@ -159,7 +159,7 @@
 						((new Character(expression.getOperator())).toString()),
 						ac);
 	    val = expression.getValue();
-	    if(val.equals(inherit) || val.equals(transparent)) {
+	    if(val.equals(inherit)) {
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssBorderRightColorCSS2(ac, expression);
@@ -168,12 +168,12 @@
 						((new Character(expression.getOperator())).toString()),
 						ac);
 	    val = expression.getValue();
-	    if(val.equals(inherit) || val.equals(transparent)) {
+	    if(val.equals(inherit)) {
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    bottom = new CssBorderBottomColorCSS2(ac, expression);
 	    val = expression.getValue();
-	    if(val.equals(inherit) || val.equals(transparent)) {
+	    if(val.equals(inherit)) {
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    left = new CssBorderLeftColorCSS2(ac, expression);
@@ -266,18 +266,18 @@
     public String toString() {
 	String ret = "";
 	if(top != null) {
-	    ret += top + " ";
+	    ret += top;
 	}
 	if(right != null) {
-	    ret += right + " ";
+	    ret += " " + right;
 	}
 	if(bottom != null) {
-	    ret += bottom + " ";
+	    ret += " " + bottom;
 	}
 	if(left != null) {
-	    ret += left;
+	    ret += " " + left;
 	}
-	return ret.trim();
+	return ret;
 	/*
 	if (right.face.equals(left.face)) {
 	    if (top.face.equals(bottom.face)) {

Index: CssPadding.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssPadding.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssPadding.java	14 Sep 2005 15:14:31 -0000	1.2
+++ CssPadding.java	19 Apr 2006 11:28:05 -0000	1.3
@@ -92,9 +92,9 @@
 	switch (count) {
 	case 1:
 	    top = new CssPaddingTop(ac, expression);
-	    bottom = new CssPaddingBottom(top);
+	    /*bottom = new CssPaddingBottom(top);
 	    right = new CssPaddingRight(top);
-	    left = new CssPaddingLeft(top);
+	    left = new CssPaddingLeft(top);*/
 	    break;
 	case 2:
 	    if (expression.getOperator() != SPACE)
@@ -109,8 +109,8 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    right = new CssPaddingRight(ac, expression);
-	    bottom = new CssPaddingBottom(top);
-	    left = new CssPaddingLeft(right);
+	    /*bottom = new CssPaddingBottom(top);
+	    left = new CssPaddingLeft(right);*/
 	    break;
 	case 3:
 	    if (expression.getOperator() != SPACE)
@@ -133,7 +133,7 @@
 		throw new InvalidParamException("unrecognize", ac);
 	    }
 	    bottom = new CssPaddingBottom(ac, expression);
-	    left = new CssPaddingLeft(right);
+	    //left = new CssPaddingLeft(right);
 	    break;
 	case 4:
 	    if (expression.getOperator() != SPACE)
@@ -226,7 +226,14 @@
 	if (inheritedValue) {
 	    return inherit.toString();
 	}
-	if (right.value.equals(left.value)) {
+        String result = "";
+        // top should never be null
+        if(top != null) result += top;
+        if(right != null) result += " " + right;
+        if(bottom != null) result += " " + bottom;
+        if(left != null) result += " " + left;
+        return result;
+	/*if (right.value.equals(left.value)) {
 	    if (top.value.equals(bottom.value)) {
 		if (top.value.equals(right.value)) {
 		    return top.toString();
@@ -238,7 +245,7 @@
 	    }
 	} else {
 	    return top + " " + right + " " + bottom + " " + left;
-	}
+	}*/
     }
 
     /**
@@ -246,10 +253,10 @@
      * Overrides this method for a macro
      */
     public void setImportant() {
-	top.important = true;
-	right.important = true;
-	bottom.important = true;
-	left.important = true;
+	if(top != null) top.important = true;
+	if(right != null) right.important = true;
+	if(bottom != null) bottom.important = true;
+	if(left != null) left.important = true;
     }
 
     /**
@@ -323,10 +330,10 @@
      */
     public void addToStyle(ApplContext ac, CssStyle style) {
 	((Css1Style) style).cssPadding.inheritedValue = inheritedValue;
-	top.addToStyle(ac, style);
-	right.addToStyle(ac, style);
-	bottom.addToStyle(ac, style);
-	left.addToStyle(ac, style);
+	if(top != null) top.addToStyle(ac, style);
+	if(right != null) right.addToStyle(ac, style);
+	if(bottom != null) bottom.addToStyle(ac, style);
+	if(left != null) left.addToStyle(ac, style);
     }
 
     /**
@@ -352,10 +359,10 @@
      */
     public void setInfo(int line, String source) {
 	super.setInfo(line, source);
-	top.setInfo(line, source);
-	right.setInfo(line, source);
-	bottom.setInfo(line, source);
-	left.setInfo(line, source);
+	if(top != null) top.setInfo(line, source);
+	if(right != null) right.setInfo(line, source);
+	if(bottom != null) bottom.setInfo(line, source);
+	if(left != null) left.setInfo(line, source);
     }
 
     /**

Index: CssBackgroundPositionCSS2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBackgroundPositionCSS2.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- CssBackgroundPositionCSS2.java	14 Sep 2005 15:14:31 -0000	1.6
+++ CssBackgroundPositionCSS2.java	19 Apr 2006 11:28:05 -0000	1.7
@@ -153,7 +153,7 @@
 		if(index2 == -1 && check) {
 		    throw new InvalidParamException("value", next, "background-position", ac);
 		}
-		// one is vertical, the other is vertical
+		// one is vertical, the other is horizontal
 		// or the two are 'center'
 		if((isHorizontal(index1) && isVertical(index2)) ||
 			(isHorizontal(index2) && isVertical(index1))) {
@@ -169,6 +169,23 @@
 		    first = val;
 		}
 	    }
+	    // a keyword and a percentage/length
+	    else if(next instanceof CssLength || next instanceof CssPercentage
+		    || next instanceof CssNumber) {
+		if(isHorizontal(index1)) {
+		    if(next instanceof CssNumber) {
+			next = ((CssNumber) next).getLength();
+		    }
+		    setFirst(val);
+		    setSecond(next);
+		}
+		// if the keyword is the first value, it can only be an
+		// horizontal one
+		else {
+		    throw new InvalidParamException("incompatible",
+			    val, next, ac);
+		}
+	    }
 	    // only one value
 	    else if(next == null || !check) {
 		first = val;
@@ -184,7 +201,25 @@
 	    if(val instanceof CssNumber) {
 		val = ((CssNumber) val).getLength();
 	    }
-	    if(next instanceof CssLength || next instanceof CssPercentage
+	    if(next instanceof CssIdent) {
+		int index = IndexOfIdent((String) next.get());
+		if(check && index == -1) {
+		    throw new InvalidParamException("value", next, "background-position", ac);
+		}
+		// the keyword must be a vertical one
+		if(isVertical(index)) {
+		    setFirst(val);
+		    setSecond(next);
+		}
+		else if(check) {
+		    throw new InvalidParamException("incompatible",
+			    val, next, ac);
+		}
+		else {
+		    setFirst(val);
+		}
+	    }
+	    else if(next instanceof CssLength || next instanceof CssPercentage
 		    || next instanceof CssNumber) {
 		if(next instanceof CssNumber) {
 		    next = ((CssNumber) next).getLength();

Received on Wednesday, 19 April 2006 11:28:27 UTC