- From: CVS User ylafon <cvsmail@w3.org>
- Date: Thu, 13 Feb 2014 15:27:01 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3 In directory roscoe:/tmp/cvs-serv9725 Modified Files: CssBoxShadow.java Log Message: aligned to the def in http://www.w3.org/TR/2014/WD-css3-background-20140204/#box-shadow, also detecting when two colors are set (was not detected before) --- /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBoxShadow.java 2012/10/18 09:46:03 1.14 +++ /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBoxShadow.java 2014/02/13 15:27:01 1.15 @@ -1,4 +1,4 @@ -// $Id: CssBoxShadow.java,v 1.14 2012/10/18 09:46:03 ylafon Exp $ +// $Id: CssBoxShadow.java,v 1.15 2014/02/13 15:27:01 ylafon Exp $ // From Sijtsche de Jong (sy.de.jong@let.rug.nl) // Rewritten 2012 by Yves Lafon <ylafon@w3.org> // @@ -24,7 +24,7 @@ import static org.w3c.css.values.CssOperator.SPACE; /** - * @spec http://www.w3.org/TR/2012/WD-css3-background-20120214/#box-shadow + * @spec http://www.w3.org/TR/2014/WD-css3-background-20140204/#box-shadow */ public class CssBoxShadow extends org.w3c.css.properties.css.CssBoxShadow { @@ -171,33 +171,29 @@ throw new InvalidParamException("value", val, getPropertyName(), ac); } - if (inset.equals(ident)) { + if (inset.equals(ident) && value.shadow_mod == null) { value.shadow_mod = inset; - // inset can be first or last - if ((value.color != null || got_length != 0) && - expression.getRemainingCount() != 1) { - throw new InvalidParamException("unrecognize", ac); - } + // inset has been relaxed break; } // if not a known ident, it must be a color // and let's use the CSS3 color. - CssExpression exp = new CssExpression(); - exp.addValue(val); - CssColor color = new CssColor(ac, exp, check); - value.color = (CssValue) color.get(); - break; + // so let it flow as if it was a color case CssTypes.CSS_HASH_IDENT: case CssTypes.CSS_COLOR: + // this one is a pain... need to remove function for colors. case CssTypes.CSS_FUNCTION: + if (value.color != null) { + throw new InvalidParamException("value", val, + getPropertyName(), ac); + } if (got_length != 0) { length_ok = false; } - // this one is a pain... need to remove function for colors. - CssExpression fexp = new CssExpression(); - fexp.addValue(val); - CssColor fcolor = new CssColor(ac, fexp, check); - value.color = (CssValue) fcolor.get(); + CssExpression exp = new CssExpression(); + exp.addValue(val); + CssColor color = new CssColor(ac, exp, check); + value.color = (CssValue) color.get(); break; default: throw new InvalidParamException("value", val,
Received on Thursday, 13 February 2014 15:27:02 UTC