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

2002/css-validator/org/w3c/css/properties/css CssDisplay.java,1.2,1.3 CssZIndex.java,1.1,1.2

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Sun, 04 Sep 2011 17:56:32 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1R0Gvo-00061W-Ow@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css
In directory hutz:/tmp/cvs-serv23057/org/w3c/css/properties/css

Modified Files:
	CssDisplay.java CssZIndex.java 
Log Message:
changing organization of some classes, fixed number of arguments for warnings about color/no bg color, preparing to get rid of some old profiles

Index: CssZIndex.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssZIndex.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssZIndex.java	5 Jan 2010 13:49:38 -0000	1.1
+++ CssZIndex.java	4 Sep 2011 17:56:30 -0000	1.2
@@ -13,74 +13,43 @@
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
 import org.w3c.css.values.CssIdent;
-import org.w3c.css.values.CssNumber;
-import org.w3c.css.values.CssTypes;
 import org.w3c.css.values.CssValue;
 
 /**
  */
 public class CssZIndex extends CssProperty {
 
-    private static final String propertyName = "z-index";
+    public static final String propertyName = "z-index";
 
     CssValue value;
 
-    private static CssIdent auto = CssIdent.getIdent("auto");
+    public static CssIdent auto = CssIdent.getIdent("auto");
 
     /**
      * Create a new CssZIndex
      */
     public CssZIndex() {
-        value = auto;
     }
 
     /**
      * Create a new CssZIndex
      *
-     * @param ac    The context
+     * @param ac         The context
      * @param expression The expression for this property
      * @param check      true will test the number of parameters
      * @throws InvalidParamException The expression is incorrect
      */
     public CssZIndex(ApplContext ac, CssExpression expression, boolean check)
             throws InvalidParamException {
+        throw new InvalidParamException("value", expression.getValue(),
+                getPropertyName(), ac);
 
-        if (check && expression.getCount() > 1) {
-            throw new InvalidParamException("unrecognize", ac);
-        }
-
-        CssValue val = expression.getValue();
-
-        setByUser();
-        switch (val.getType()) {
-            case CssTypes.CSS_NUMBER:
-                if (((CssNumber) val).isInteger()) {
-                    value = val;
-                    break;
-                }
-                throw new InvalidParamException("integer",
-                    val.toString(),
-                    getPropertyName(), ac);
-            case CssTypes.CSS_IDENT:
-                CssIdent ide = (CssIdent) val;
-                if (inherit.equals(ide)) {
-                    value = inherit;
-                    break;
-                } else if (auto.equals(ide)) {
-                    value = auto;
-                    break;
-                }
-            default:
-                throw new InvalidParamException("value", expression.getValue(),
-                        getPropertyName(), ac);
-        }
-        expression.next();
     }
 
     /**
      * Create a new CssZIndex
      *
-     * @param ac, the Context
+     * @param ac,        the Context
      * @param expression The expression for this property
      * @throws InvalidParamException The expression is incorrect
      */
@@ -161,7 +130,7 @@
      * It is used by all macro for the function <code>print</code>
      */
     public boolean isDefault() {
-        return (value == auto);
+        return false;
     }
 
 }

Index: CssDisplay.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssDisplay.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssDisplay.java	5 Jan 2010 19:49:50 -0000	1.2
+++ CssDisplay.java	4 Sep 2011 17:56:30 -0000	1.3
@@ -12,10 +12,6 @@
 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;
-
-import java.util.HashMap;
 
 /**
  * The 'display' property
@@ -27,21 +23,8 @@
 
     public CssIdent value;
     public static CssIdent inline;
-    private static HashMap<String, CssIdent> allowed_values;
 
     static {
-        allowed_values = new HashMap<String, CssIdent>();
-
-        String[] DISPLAY = {
-                "inline", "block", "list-item", "run-in", "inline-block",
-                "table", "inline-table", "table-row-group",
-                "table-header-group", "table-footer-group",
-                "table-row", "table-column-group", "table-column",
-                "table-cell", "table-caption", "none"};
-
-        for (String aDISPLAY : DISPLAY) {
-            allowed_values.put(aDISPLAY, CssIdent.getIdent(aDISPLAY));
-        }
         inline = CssIdent.getIdent("inline");
     }
 
@@ -62,29 +45,6 @@
      */
     public CssDisplay(ApplContext ac, CssExpression expression,
                       boolean check) throws InvalidParamException {
-
-        if (check && expression.getCount() > 1) {
-            throw new InvalidParamException("unrecognize", ac);
-        }
-
-        CssValue val = expression.getValue();
-
-        setByUser();
-
-        if (val.getType() == CssTypes.CSS_IDENT) {
-            CssIdent id_val = (CssIdent) val;
-            String id_value = id_val.toString();
-            if (inherit.equals(id_val)) {
-                value = inherit;
-            } else {
-                value = allowed_values.get(id_value);
-            }
-            if (value != null) {
-                expression.next();
-                return;
-            }
-        }
-
         throw new InvalidParamException("value", expression.getValue(),
                 getPropertyName(), ac);
     }
Received on Sunday, 4 September 2011 17:56:34 UTC

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