W3C home > Mailing lists > Public > www-validator-cvs@w3.org > October 2011

2002/css-validator/org/w3c/css/properties/css3 CssBackground.java,1.1,1.2

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 31 Oct 2011 13:15:19 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1RKrhv-00082L-Vm@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv30879/org/w3c/css/properties/css3

Modified Files:
	CssBackground.java 
Log Message:
color can be a CSS_FUNCTION (fixes http://www.w3.org/Bugs/Public/show_bug.cgi?id=13978

Index: CssBackground.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBackground.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssBackground.java	4 Oct 2011 13:05:25 -0000	1.1
+++ CssBackground.java	31 Oct 2011 13:15:17 -0000	1.2
@@ -91,7 +91,8 @@
      * Does not check the number of values
      *
      * @param expression The expression for this property
-     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
+     * @throws org.w3c.css.util.InvalidParamException
+     *          The expression is incorrect
      */
     public CssBackground(ApplContext ac, CssExpression expression)
             throws InvalidParamException {
@@ -103,7 +104,8 @@
      *
      * @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
+     * @throws org.w3c.css.util.InvalidParamException
+     *          The expression is incorrect
      */
     public CssBackground(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
@@ -515,6 +517,19 @@
                     }
                     // unrecognized or unwanted ident
                     // let it fail now
+                case CssTypes.CSS_FUNCTION:
+                    // function can only be a color here
+                    // we already got one, fail...
+                    if (v.color != null || next_is_size || !is_final) {
+                        throw new InvalidParamException("value", val,
+                                getPropertyName(), ac);
+                    }
+                    exp = new CssExpression();
+                    exp.addValue(val);
+
+                    bg_color = new CssBackgroundColor(ac, exp, check);
+                    v.color = (CssValue) bg_color.get();
+                    break;
                 default:
                     throw new InvalidParamException("value", val,
                             getPropertyName(), ac);
Received on Monday, 31 October 2011 13:15:25 UTC

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