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

2002/css-validator/org/w3c/css/properties/css CssBackgroundConstants.java,1.1,1.2 CssBreakAfter.java,1.2,1.3 CssBreakBefore.java,1.2,1.3 CssBreakInside.java,1.2,1.3

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 04 Oct 2011 20:08:14 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1RBBHi-0002uA-3V@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css
In directory hutz:/tmp/cvs-serv11126/org/w3c/css/properties/css

Modified Files:
	CssBackgroundConstants.java CssBreakAfter.java 
	CssBreakBefore.java CssBreakInside.java 
Log Message:
reorg

Index: CssBreakBefore.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssBreakBefore.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssBreakBefore.java	5 Jan 2010 19:49:50 -0000	1.2
+++ CssBreakBefore.java	4 Oct 2011 20:08:11 -0000	1.3
@@ -13,12 +13,8 @@
 import org.w3c.css.util.ApplContext;
 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;
-
 /**
  * http://www.w3.org/TR/2009/CR-css3-multicol-20091217/#column-breaks
  * <p/>
@@ -45,28 +41,14 @@
 
 public class CssBreakBefore extends CssProperty {
 
-    private static final String propertyName = "break-before";
-
-    static CssIdent auto;
-    private static HashMap<String, CssIdent> allowed_values;
 
-    CssIdent value;
+    CssValue value;
 
-    static {
-        allowed_values = new HashMap<String, CssIdent>();
-        auto = CssIdent.getIdent("auto");
-        String id_values[] = {"auto", "always", "avoid", "left", "right",
-                "page", "column", "avoid-page", "avoid-column"};
-        for (String s : id_values) {
-            allowed_values.put(s, CssIdent.getIdent(s));
-        }
-    }
 
     /**
      * Create a new CssColumnWidth
      */
     public CssBreakBefore() {
-        value = auto;
     }
 
     /**
@@ -79,31 +61,8 @@
      */
     public CssBreakBefore(ApplContext ac, CssExpression expression,
                           boolean check) throws InvalidParamException {
-        setByUser();
-        CssValue val = expression.getValue();
 
-        if (check && expression.getCount() > 1) {
             throw new InvalidParamException("unrecognize", ac);
-        }
-
-        if (val.getType() != CssTypes.CSS_IDENT) {
-            throw new InvalidParamException("value",
-                    expression.getValue(),
-                    getPropertyName(), ac);
-        }
-        // ident, so inherit, or allowed value
-        if (inherit.equals(val)) {
-            value = inherit;
-        } else {
-            val = allowed_values.get(val.toString());
-            if (val == null) {
-                throw new InvalidParamException("value",
-                        expression.getValue(),
-                        getPropertyName(), ac);
-            }
-            value = (CssIdent) val;
-        }
-        expression.next();
     }
 
     public CssBreakBefore(ApplContext ac, CssExpression expression)
@@ -150,7 +109,7 @@
      * Returns the name of this property
      */
     public final String getPropertyName() {
-        return propertyName;
+        return "break-before";
     }
 
     /**
@@ -179,7 +138,7 @@
      * It is used by all macro for the function <code>print</code>
      */
     public boolean isDefault() {
-        return (auto == value);
+        return false;
     }
 
 }

Index: CssBackgroundConstants.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssBackgroundConstants.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssBackgroundConstants.java	5 Jan 2010 13:49:37 -0000	1.1
+++ CssBackgroundConstants.java	4 Oct 2011 20:08:11 -0000	1.2
@@ -10,6 +10,7 @@
  * @version $Revision$
  */
 public interface CssBackgroundConstants {
+    // TODO REMOVE (and clear other background classes)
   static String[] REPEAT = { "repeat", "repeat-x", "repeat-y", "no-repeat", "inherit" };
     
   static String[] ATTACHMENT = { "scroll", "fixed", "inherit" };

Index: CssBreakInside.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssBreakInside.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssBreakInside.java	5 Jan 2010 19:49:50 -0000	1.2
+++ CssBreakInside.java	4 Oct 2011 20:08:12 -0000	1.3
@@ -13,59 +13,20 @@
 import org.w3c.css.util.ApplContext;
 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;
-
 /**
- * http://www.w3.org/TR/2009/CR-css3-multicol-20091217/#column-breaks
- * <p/>
- * When content is laid out in multiple columns, the user agent must determine
- * where column breaks are placed. The problem of breaking content into columns
- * is similar to breaking content into pages.
- * <p/>
- * Three new properties are introduced to allow column breaks to be described
- * in the same properties as page breaks: ‘break-before’, ‘break-after’, and
- * ‘break-inside’. These properties take the same values as
- * ‘page-break-before’, ‘page-break-after’, and ‘page-break-inside’ [CSS21].
- * In addition, some new keyword values are added.
- * <p/>
- * Name:  	break-inside
- * Value: 	auto | avoid | avoid-page | avoid-column
- * Initial: 	auto
- * Applies to: 	block-level elements
- * Inherited: 	no
- * Percentages: 	N/A
- * Media: 	paged
- * Computed value: 	specified value
+* Introduced in CSS3
  */
 
 public class CssBreakInside extends CssProperty {
 
-    private static final String propertyName = "break-inside";
-
-    static CssIdent auto;
-    private static HashMap<String, CssIdent> allowed_values;
-
-    CssIdent value;
-
-    static {
-        allowed_values = new HashMap<String, CssIdent>();
-        auto = CssIdent.getIdent("auto");
-        String id_values[] = {"auto", "always", "avoid", "left", "right",
-                "page", "column", "avoid-page", "avoid-column"};
-        for (String s : id_values) {
-            allowed_values.put(s, CssIdent.getIdent(s));
-        }
-    }
+    CssValue value;
 
     /**
      * Create a new CssColumnWidth
      */
     public CssBreakInside() {
-        value = auto;
     }
 
     /**
@@ -76,31 +37,7 @@
      */
     public CssBreakInside(ApplContext ac, CssExpression expression,
                           boolean check) throws InvalidParamException {
-        setByUser();
-        CssValue val = expression.getValue();
-
-        if (check && expression.getCount() > 1) {
             throw new InvalidParamException("unrecognize", ac);
-        }
-
-        if (val.getType() != CssTypes.CSS_IDENT) {
-            throw new InvalidParamException("value",
-                    expression.getValue(),
-                    getPropertyName(), ac);
-        }
-        // ident, so inherit, or allowed value
-        if (inherit.equals(val)) {
-            value = inherit;
-        } else {
-            val = allowed_values.get(val.toString());
-            if (val == null) {
-                throw new InvalidParamException("value",
-                        expression.getValue(),
-                        getPropertyName(), ac);
-            }
-            value = (CssIdent)val;
-        }
-        expression.next();
     }
 
     public CssBreakInside(ApplContext ac, CssExpression expression)
@@ -147,7 +84,7 @@
      * Returns the name of this property
      */
     public final String getPropertyName() {
-        return propertyName;
+        return "break-inside";
     }
 
     /**
@@ -176,7 +113,7 @@
      * It is used by all macro for the function <code>print</code>
      */
     public boolean isDefault() {
-        return (auto == value);
+        return false;
     }
 
 }

Index: CssBreakAfter.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssBreakAfter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssBreakAfter.java	5 Jan 2010 19:49:50 -0000	1.2
+++ CssBreakAfter.java	4 Oct 2011 20:08:11 -0000	1.3
@@ -13,60 +13,21 @@
 import org.w3c.css.util.ApplContext;
 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;
-
 /**
- * http://www.w3.org/TR/2009/CR-css3-multicol-20091217/#column-breaks
- * <p/>
- * When content is laid out in multiple columns, the user agent must determine
- * where column breaks are placed. The problem of breaking content into columns
- * is similar to breaking content into pages.
- * <p/>
- * Three new properties are introduced to allow column breaks to be described
- * in the same properties as page breaks: ‘break-before’, ‘break-after’, and
- * ‘break-inside’. These properties take the same values as
- * ‘page-break-before’, ‘page-break-after’, and ‘page-break-inside’ [CSS21].
- * In addition, some new keyword values are added.
- * <p/>
- * Name:  	break-after
- * Value: 	auto | always | avoid | left | right | page | column |
- * avoid-page | avoid-column
- * Initial: 	auto
- * Applies to: 	block-level elements
- * Inherited: 	no
- * Percentages: 	N/A
- * Media: 	paged
- * Computed value: 	specified value
+ * Present starting with CSS3
  */
 
 public class CssBreakAfter extends CssProperty {
 
-    private static final String propertyName = "break-after";
-
-    static CssIdent auto;
-    private static HashMap<String, CssIdent> allowed_values;
 
-    CssIdent value;
-
-    static {
-        allowed_values = new HashMap<String, CssIdent>();
-        auto = CssIdent.getIdent("auto");
-        String id_values[] = {"auto", "always", "avoid", "left", "right",
-                "page", "column", "avoid-page", "avoid-column"};
-        for (String s : id_values) {
-            allowed_values.put(s, CssIdent.getIdent(s));
-        }
-    }
+    CssValue value;
 
     /**
      * Create a new CssColumnWidth
      */
     public CssBreakAfter() {
-        value = auto;
     }
 
     /**
@@ -77,32 +38,7 @@
      */
     public CssBreakAfter(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
-
-        setByUser();
-        CssValue val = expression.getValue();
-
-        if (check && expression.getCount() > 1) {
-            throw new InvalidParamException("unrecognize", ac);
-        }
-
-        if (val.getType() != CssTypes.CSS_IDENT) {
-            throw new InvalidParamException("value",
-                    expression.getValue(),
-                    getPropertyName(), ac);
-        }
-        // ident, so inherit, or allowed value
-        if (inherit.equals(val)) {
-            value = inherit;
-        } else {
-            val = allowed_values.get(val.toString());
-            if (val == null) {
-                throw new InvalidParamException("value",
-                        expression.getValue(),
-                        getPropertyName(), ac);
-            }
-            value = (CssIdent) val;
-        }
-        expression.next();
+        throw new InvalidParamException("unrecognize", ac);
     }
 
     public CssBreakAfter(ApplContext ac, CssExpression expression)
@@ -149,7 +85,7 @@
      * Returns the name of this property
      */
     public final String getPropertyName() {
-        return propertyName;
+        return "break-after";
     }
 
     /**
@@ -178,7 +114,7 @@
      * It is used by all macro for the function <code>print</code>
      */
     public boolean isDefault() {
-        return (auto == value);
+        return false;
     }
 
 }
Received on Tuesday, 4 October 2011 20:08:20 UTC

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