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

CVS 2002/css-validator/org/w3c/css/values

From: CVS User ylafon <cvsmail@w3.org>
Date: Sat, 17 Nov 2012 20:40:00 +0000
Message-Id: <E1TZpBI-0006UE-OM@roscoe.w3.org>
To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/values
In directory roscoe:/tmp/cvs-serv24891

Modified Files:
	CssColorCSS3.java CssImage.java 
Log Message:
currentColor...

--- /sources/public/2002/css-validator/org/w3c/css/values/CssColorCSS3.java	2011/09/29 09:09:00	1.1
+++ /sources/public/2002/css-validator/org/w3c/css/values/CssColorCSS3.java	2012/11/17 20:40:00	1.2
@@ -1,4 +1,4 @@
-// $Id: CssColorCSS3.java,v 1.1 2011/09/29 09:09:00 ylafon Exp $
+// $Id: CssColorCSS3.java,v 1.2 2012/11/17 20:40:00 ylafon Exp $
 // Author: Jean-Guilhem Rouel
 // (c) COPYRIGHT MIT, ERCIM and Keio, 2005.
 // Please first read the full copyright statement in file COPYRIGHT.html
@@ -13,6 +13,8 @@
     protected static final HashMap<String, RGB> definedRGBColorsCSS3;
     private static final RGBA trans;
 
+	static final CssIdent currentColor = CssIdent.getIdent("currentColor");
+
     public static RGB getRGB(String ident) {
         return definedRGBColorsCSS3.get(ident);
     }
--- /sources/public/2002/css-validator/org/w3c/css/values/CssImage.java	2012/11/12 08:47:25	1.6
+++ /sources/public/2002/css-validator/org/w3c/css/values/CssImage.java	2012/11/17 20:40:00	1.7
@@ -1,4 +1,4 @@
-// $Id: CssImage.java,v 1.6 2012/11/12 08:47:25 ylafon Exp $
+// $Id: CssImage.java,v 1.7 2012/11/17 20:40:00 ylafon Exp $
 // Author: Yves Lafon <ylafon@w3.org>
 //
 // (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
@@ -149,6 +149,11 @@
 					gotcolor = true;
 					break;
 				case CssTypes.CSS_IDENT:
+					if (CssColorCSS3.currentColor.equals((CssIdent) val)) {
+						v.add(val);
+						gotcolor = true;
+						break;
+					}
 					c = new CssColor();
 					c.setIdentColor(val.toString(), ac);
 					v.add(c);
@@ -530,6 +535,7 @@
 		CssValue val;
 		char op;
 		CssColor stopcol;
+		CssValue stopcolv;
 		CssValue stopval;
 
 		while (!expression.end()) {
@@ -540,13 +546,19 @@
 				case CssTypes.CSS_HASH_IDENT:
 					stopcol = new CssColor();
 					stopcol.setShortRGBColor(val.toString(), ac);
+					stopcolv = stopcol;
 					break;
 				case CssTypes.CSS_IDENT:
+					if (CssColorCSS3.currentColor.equals((CssIdent) val)) {
+						stopcolv = CssColorCSS3.currentColor;
+						break;
+					}
 					stopcol = new CssColor();
 					stopcol.setIdentColor(val.toString(), ac);
+					stopcolv = stopcol;
 					break;
 				case CssTypes.CSS_COLOR:
-					stopcol = (CssColor) val;
+					stopcolv = val;
 					break;
 				default:
 					throw new InvalidParamException("value", val.toString(),
@@ -563,7 +575,7 @@
 					case CssTypes.CSS_LENGTH:
 					case CssTypes.CSS_PERCENTAGE:
 						ArrayList<CssValue> stop = new ArrayList<CssValue>(2);
-						stop.add(stopcol);
+						stop.add(stopcolv);
 						stop.add(stopval);
 						v.add(new CssValueList(stop));
 						break;
@@ -572,7 +584,7 @@
 								"color-stop", ac);
 				}
 			} else {
-				v.add(stopcol);
+				v.add(stopcolv);
 			}
 			expression.next();
 			if (!expression.end() && op != COMMA) {
Received on Saturday, 17 November 2012 20:40:07 UTC

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