- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 11 Feb 2009 22:43:17 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css21 In directory hutz:/tmp/cvs-serv8090/css21 Modified Files: CssBackgroundColorCSS21.java Log Message: small rewrites Index: CssBackgroundColorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBackgroundColorCSS21.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CssBackgroundColorCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 +++ CssBackgroundColorCSS21.java 11 Feb 2009 22:43:15 -0000 1.3 @@ -9,6 +9,7 @@ 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; /** @@ -40,24 +41,27 @@ setByUser(); CssValue val = expression.getValue(); - if (val instanceof org.w3c.css.values.CssColor) { + switch (val.getType()) { + case CssTypes.CSS_COLOR: setColor(val); - expression.next(); - } else if (val instanceof CssIdent) { - if (val.equals(transparent)) { + break; + case CssTypes.CSS_IDENT: + if (transparent.equals(val)) { setColor(transparent); - expression.next(); - } else if (val.equals(inherit)) { + break; + } + if (inherit.equals(val)) { setColor(inherit); - expression.next(); - } else { - setColor(new org.w3c.css.values.CssColorCSS21(ac, (String) val.get())); - expression.next(); - } - } else { + break; + } + setColor(new org.w3c.css.values.CssColorCSS21(ac, + (String) val.get())); + break; + default: throw new InvalidParamException("value", val.toString(), getPropertyName(), ac); } + expression.next(); } public CssBackgroundColorCSS21(ApplContext ac, CssExpression expression)
Received on Wednesday, 11 February 2009 22:43:27 UTC