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

2002/css-validator/org/w3c/css/properties/css3 CssTransitionDelay.java,NONE,1.1 CssTransitionDuration.java,NONE,1.1 Css3Style.java,1.97,1.98

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 03 Oct 2012 09:49:20 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1TJLZw-0005RI-3v@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv20801/d/css3

Modified Files:
	Css3Style.java 
Added Files:
	CssTransitionDelay.java CssTransitionDuration.java 
Log Message:
added transition-duration and transntion-delay per http://www.w3.org/TR/2012/WD-css3-transitions-20120403/

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- Css3Style.java	28 Sep 2012 11:30:59 -0000	1.97
+++ Css3Style.java	3 Oct 2012 09:49:17 -0000	1.98
@@ -61,6 +61,8 @@
 import org.w3c.css.properties.css.CssTextEmphasisStyle;
 import org.w3c.css.properties.css.CssTextJustify;
 import org.w3c.css.properties.css.CssTextUnderlinePosition;
+import org.w3c.css.properties.css.CssTransitionDelay;
+import org.w3c.css.properties.css.CssTransitionDuration;
 import org.w3c.css.properties.css.CssWordBreak;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.Util;
@@ -137,6 +139,9 @@
 	public CssMarqueePlayCount cssMarqueePlayCount;
 	public CssOverflowStyle cssOverflowStyle;
 
+	public CssTransitionDelay cssTransitionDelay;
+	public CssTransitionDuration cssTransitionDuration;
+	
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
 	CssDropInitialBeforeAdjust cssDropInitialBeforeAdjust;
@@ -1067,6 +1072,25 @@
 		}
 		return cssTabSize;
 	}
+
+	public CssTransitionDelay getTransitionDelay() {
+		if (cssTransitionDelay == null) {
+			cssTransitionDelay =
+					(CssTransitionDelay) style.CascadingOrder(
+							new CssTransitionDelay(), style, selector);
+		}
+		return cssTransitionDelay;
+	}
+
+	public CssTransitionDuration getTransitionDuration() {
+		if (cssTransitionDuration == null) {
+			cssTransitionDuration =
+					(CssTransitionDuration) style.CascadingOrder(
+							new CssTransitionDuration(), style, selector);
+		}
+		return cssTransitionDuration;
+	}
+
 	///
 
 	/**

--- NEW FILE: CssTransitionDuration.java ---
// $Id: CssTransitionDuration.java,v 1.1 2012/10/03 09:49:17 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (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.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssLayerList;
import org.w3c.css.values.CssTime;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;

import java.util.ArrayList;

import static org.w3c.css.values.CssOperator.COMMA;

/**
 * @spec http://www.w3.org/TR/2012/WD-css3-transitions-20120403/#transition-duration
 */
public class CssTransitionDuration extends org.w3c.css.properties.css.CssTransitionDuration {

	/**
	 * Create a new CssTransitionDuration
	 */
	public CssTransitionDuration() {
		value = initial;
	}

	/**
	 * Creates a new CssTransitionDuration
	 *
	 * @param expression The expression for this property
	 * @throws org.w3c.css.util.InvalidParamException
	 *          Expressions are incorrect
	 */
	public CssTransitionDuration(ApplContext ac, CssExpression expression, boolean check)
			throws InvalidParamException {
		setByUser();

		CssValue val;
		char op;
		ArrayList<CssValue> values = new ArrayList<CssValue>();
		boolean gotinherit = false;

		while (!expression.end()) {
			val = expression.getValue();
			op = expression.getOperator();
			switch (val.getType()) {
				case CssTypes.CSS_TIME:
					CssTime t = val.getTime();
					t.warnPositiveness(ac, this);
					values.add(val);
					break;
				case CssTypes.CSS_IDENT:
					if (inherit.equals(val)) {
						gotinherit = true;
						values.add(inherit);
						break;
					}
				default:
					throw new InvalidParamException("value",
							val.toString(),
							getPropertyName(), ac);
			}
			expression.next();
			if (!expression.end() && (op != COMMA)) {
				throw new InvalidParamException("operator",
						((new Character(op)).toString()), ac);
			}
		}
		if (gotinherit && values.size() > 1) {
			throw new InvalidParamException("value",
					inherit.toString(),
					getPropertyName(), ac);
		}
		value = (values.size() == 1) ? values.get(0) : new CssLayerList(values);
	}

	public CssTransitionDuration(ApplContext ac, CssExpression expression)
			throws InvalidParamException {
		this(ac, expression, false);
	}
}


--- NEW FILE: CssTransitionDelay.java ---
// $Id: CssTransitionDelay.java,v 1.1 2012/10/03 09:49:17 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (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.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssLayerList;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;

import java.util.ArrayList;

import static org.w3c.css.values.CssOperator.COMMA;

/**
 * @spec http://www.w3.org/TR/2012/WD-css3-transitions-20120403/#transition-delay
 */
public class CssTransitionDelay extends org.w3c.css.properties.css.CssTransitionDelay {

	/**
	 * Create a new CssTransitionDelay
	 */
	public CssTransitionDelay() {
		value = initial;
	}

	/**
	 * Creates a new CssTransitionDelay
	 *
	 * @param expression The expression for this property
	 * @throws org.w3c.css.util.InvalidParamException
	 *          Expressions are incorrect
	 */
	public CssTransitionDelay(ApplContext ac, CssExpression expression, boolean check)
			throws InvalidParamException {
		setByUser();

		CssValue val;
		char op;
		ArrayList<CssValue> values = new ArrayList<CssValue>();
		boolean gotinherit = false;

		while (!expression.end()) {
			val = expression.getValue();
			op = expression.getOperator();
			switch (val.getType()) {
				case CssTypes.CSS_TIME:
					values.add(val);
					break;
				case CssTypes.CSS_IDENT:
					if (inherit.equals(val)) {
						gotinherit = true;
						values.add(inherit);
						break;
					}
				default:
					throw new InvalidParamException("value",
							val.toString(),
							getPropertyName(), ac);
			}
			expression.next();
			if (!expression.end() && (op != COMMA)) {
				throw new InvalidParamException("operator",
						((new Character(op)).toString()), ac);
			}
		}
		if (gotinherit && values.size() > 1) {
			throw new InvalidParamException("value",
					inherit.toString(),
					getPropertyName(), ac);
		}
		value = (values.size() == 1) ? values.get(0) : new CssLayerList(values);
	}

	public CssTransitionDelay(ApplContext ac, CssExpression expression)
			throws InvalidParamException {
		this(ac, expression, false);
	}
}
Received on Wednesday, 3 October 2012 09:49:21 UTC

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