W3C home > Mailing lists > Public > www-validator-cvs@w3.org > November 2012

2002/css-validator/org/w3c/css/properties/css2 Css2Style.java,1.18,1.19 CssDirection.java,1.1,1.2

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 05 Nov 2012 13:43:21 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1TVMxV-0005Sy-Bb@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css2
In directory hutz:/tmp/cvs-serv20880/css2

Modified Files:
	Css2Style.java CssDirection.java 
Log Message:
direction - fix with @spec links, added css3 and atsc cleanup

Index: Css2Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/Css2Style.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- Css2Style.java	5 Nov 2012 10:36:13 -0000	1.18
+++ Css2Style.java	5 Nov 2012 13:43:19 -0000	1.19
@@ -11,6 +11,7 @@
 import org.w3c.css.properties.css.CssBottom;
 import org.w3c.css.properties.css.CssClip;
 import org.w3c.css.properties.css.CssCursor;
+import org.w3c.css.properties.css.CssDirection;
 import org.w3c.css.properties.css.CssLeft;
 import org.w3c.css.properties.css.CssMarkerOffset;
 import org.w3c.css.properties.css.CssMaxHeight;
@@ -73,6 +74,8 @@
 
 	public CssClip cssClip;
 	public CssMarkerOffset cssMarkerOffset;
+	public CssDirection cssDirection;
+
 
 	/**
 	 * Get the azimuth
@@ -332,7 +335,17 @@
 		}
 		return cssClip;
 	}
-
+	/**
+	 * Get the direction property
+	 */
+	public final CssDirection getDirection() {
+		if (cssDirection == null) {
+			cssDirection =
+					(CssDirection) style.CascadingOrder(new CssDirection(),
+							style, selector);
+		}
+		return cssDirection;
+	}
 
 	/**
 	 * Find conflicts in this Style

Index: CssDirection.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/CssDirection.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssDirection.java	4 Sep 2011 21:02:00 -0000	1.1
+++ CssDirection.java	5 Nov 2012 13:43:19 -0000	1.2
@@ -1,33 +1,21 @@
-//
 // $Id$
-// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
+// Author: Yves Lafon <ylafon@w3.org>
 //
-// (c) COPYRIGHT MIT and INRIA, 1997.
+// (c) COPYRIGHT MIT, ERCIM and Keio University, 2011.
 // Please first read the full copyright statement in file COPYRIGHT.html
-/*
- */
 package org.w3c.css.properties.css2;
 
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssTypes;
 import org.w3c.css.values.CssValue;
 
 /**
- * See
- * http://www.w3.org/TR/2008/REC-CSS2-20080411/visuren.html#propdef-direction
- *
- * 'direction'
-    Value:  	ltr | rtl | inherit
-    Initial:  	ltr
-    Applies to:  	all elements, but see prose
-    Inherited:  	yes
-    Percentages:  	N/A
-    Media:  	visual
+ * @spec http://www.w3.org/TR/2008/REC-CSS2-20080411/visuren.html#propdef-direction
  */
 public class CssDirection extends org.w3c.css.properties.css.CssDirection {
 
-
     /**
      * Create a new CssDirection
      */
@@ -51,20 +39,21 @@
         CssValue val = expression.getValue();
 
         setByUser();
+		if (val.getType() != CssTypes.CSS_IDENT) {
+			throw new InvalidParamException("value", expression.getValue(),
+					getPropertyName(), ac);
+		}
         if (val.equals(inherit)) {
             value = inherit;
-            expression.next();
         } else if (val.equals(ltr)) {
             value = ltr;
-            expression.next();
         } else if (val.equals(rtl)) {
             value = rtl;
-            expression.next();
         } else {
             throw new InvalidParamException("value", expression.getValue(),
                     getPropertyName(), ac);
         }
-
+		expression.next();
     }
 
     public CssDirection(ApplContext ac, CssExpression expression)
Received on Monday, 5 November 2012 13:43:35 UTC

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