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

2002/css-validator/org/w3c/css/properties/css3 Css3Style.java,1.132,1.133 CssNavIndex.java,1.3,1.4

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 17 Oct 2012 09:30:04 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1TOPwy-0003Zh-42@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv13598/css3

Modified Files:
	Css3Style.java CssNavIndex.java 
Log Message:
nav-index per http://www.w3.org/TR/2012/WD-css3-ui-20120117/#nav-index0

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- Css3Style.java	17 Oct 2012 08:16:24 -0000	1.132
+++ Css3Style.java	17 Oct 2012 09:30:00 -0000	1.133
@@ -69,6 +69,7 @@
 import org.w3c.css.properties.css.CssMarqueePlayCount;
 import org.w3c.css.properties.css.CssMarqueeSpeed;
 import org.w3c.css.properties.css.CssMarqueeStyle;
+import org.w3c.css.properties.css.CssNavIndex;
 import org.w3c.css.properties.css.CssOpacity;
 import org.w3c.css.properties.css.CssOrder;
 import org.w3c.css.properties.css.CssOutlineOffset;
@@ -211,6 +212,7 @@
 	public CssResize cssResize;
 	public CssOutlineOffset cssOutlineOffset;
 	public CssImeMode cssImeMode;
+	public CssNavIndex cssNavIndex;
 
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
@@ -226,7 +228,6 @@
 	CssTextHeight cssTextHeight;
 	CssAppearance cssAppearance;
 	CssIcon cssIcon;
-	CssNavIndex cssNavIndex;
 	CssNavUp cssNavUp;
 	CssNavRight cssNavRight;
 	CssNavDown cssNavDown;

Index: CssNavIndex.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssNavIndex.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssNavIndex.java	5 Jan 2010 13:49:53 -0000	1.3
+++ CssNavIndex.java	17 Oct 2012 09:30:01 -0000	1.4
@@ -1,137 +1,88 @@
-//
 // $Id$
-// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
+// Author: Yves Lafon <ylafon@w3.org>
 //
-// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
-// Please first read the full copyright statement at
-// http://www.w3.org/Consortium/Legal/copyright-software-19980720
-
+// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
+// Please first read the full copyright statement in file COPYRIGHT.html
 package org.w3c.css.properties.css3;
 
-import org.w3c.css.parser.CssStyle;
-import org.w3c.css.properties.css.CssProperty;
 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.CssNumber;
+import org.w3c.css.values.CssTypes;
 import org.w3c.css.values.CssValue;
 
-public class CssNavIndex extends CssProperty {
-
-    CssValue navindex;
+/**
+ * @spec http://www.w3.org/TR/2012/WD-css3-ui-20120117/#nav-index0
+ */
+public class CssNavIndex extends org.w3c.css.properties.css.CssNavIndex {
 
-    static CssIdent auto = new CssIdent("auto");
+	public static final CssIdent auto = CssIdent.getIdent("auto");
+	/**
+	 * Create a new CssNavIndex
+	 */
+	public CssNavIndex() {
+		value = initial;
+	}
 
-    /**
-     * Create a new CssNavIndex
-     */
-    public CssNavIndex() {
-	// nothing to do
-    }
+	/**
+	 * Create a new CssNavIndex
+	 *
+	 * @param ac         The context
+	 * @param expression The expression for this property
+	 * @param check      true will test the number of parameters
+	 * @throws org.w3c.css.util.InvalidParamException
+	 *          The expression is incorrect
+	 */
+	public CssNavIndex(ApplContext ac, CssExpression expression, boolean check)
+			throws InvalidParamException {
 
-    /**
-     * Create a new CssNavIndex
-     *
-     * @param expression The expression for this property
-     * @exception InvalidParamException Incorrect value
-     */
-    public CssNavIndex(ApplContext ac, CssExpression expression,
-	    boolean check) throws InvalidParamException {
+		if (check && expression.getCount() > 1) {
+			throw new InvalidParamException("unrecognize", ac);
+		}
 
-	setByUser();
-	CssValue val = expression.getValue();
+		CssValue val = expression.getValue();
 
-	if (val.equals(inherit)) {
-	    navindex = val;
-	    expression.next();
-	} else if (val.equals(auto)) {
-	    navindex = val;
-	    expression.next();
-	} else if (val instanceof CssNumber) {
-	    navindex = val;
-	    expression.next();
-	} else {
-	    throw new InvalidParamException("value", expression.getValue(),
-					    getPropertyName(), ac);
+		setByUser();
+		switch (val.getType()) {
+			case CssTypes.CSS_NUMBER:
+				CssNumber number = val.getNumber();
+				number.checkStrictPositiveness(ac, this);
+				number.checkInteger(ac, this);
+				value = val;
+				break;
+			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();
 	}
-    }
-
-    public CssNavIndex(ApplContext ac, CssExpression expression)
-	    throws InvalidParamException {
-	this(ac, expression, false);
-    }
 
-    /**
-     * Add this property to the CssStyle
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-	if (((Css3Style) style).cssNavIndex != null)
-	    style.addRedefinitionWarning(ac, this);
-	((Css3Style) style).cssNavIndex = this;
-    }
-
-    /**
-     * Get this property in the style.
-     *
-     * @param style The style where the property is
-     * @param resolve if true, resolve the style to find this property
-     */
-    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
-	if (resolve) {
-	    return ((Css3Style) style).getNavIndexCSS3();
-	}
-	else {
-	    return ((Css3Style) style).cssNavIndex;
+	/**
+	 * Create a new CssNavIndex
+	 *
+	 * @param ac,        the Context
+	 * @param expression The expression for this property
+	 * @throws org.w3c.css.util.InvalidParamException
+	 *          The expression is incorrect
+	 */
+	public CssNavIndex(ApplContext ac, CssExpression expression)
+			throws InvalidParamException {
+		this(ac, expression, false);
 	}
-    }
-
-    /**
-     * Compares two properties for equality.
-     *
-     * @param value The other property.
-     */
-    public boolean equals(CssProperty property) {
-	return (property instanceof CssNavIndex &&
-		navindex.equals(((CssNavIndex) property).navindex));
-    }
 
-    /**
-     * Returns the name of this property
-     */
-    public String getPropertyName() {
-	return "nav-index";
-    }
-
-    /**
-     * Returns the value of this property
-     */
-    public Object get() {
-	return navindex;
-    }
-
-    /**
-     * Returns true if this property is "softly" inherited
-     */
-    public boolean isSoftlyInherited() {
-	return navindex.equals(inherit);
-    }
-
-    /**
-     * Returns a string representation of the object
-     */
-    public String toString() {
-	return navindex.toString();
-    }
-
-    /**
-     * Is the value of this property a default value
-     * It is used by alle macro for the function <code>print</code>
-     */
-    public boolean isDefault() {
-	return (navindex == auto);
-    }
+	public boolean isDefault() {
+		return (auto == value) || (auto == initial);
+	}
 
 }
Received on Wednesday, 17 October 2012 09:30:06 UTC

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