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

2002/css-validator/org/w3c/css/properties/css3 CssTransitionProperty.java,NONE,1.1 Css3Style.java,1.98,1.99

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 03 Oct 2012 10:21:24 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1TJM4y-0003LF-Tg@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv12762/css3

Modified Files:
	Css3Style.java 
Added Files:
	CssTransitionProperty.java 
Log Message:
transition-property per http://www.w3.org/TR/2012/WD-css3-transitions-20120403/#transition-property

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- Css3Style.java	3 Oct 2012 09:49:17 -0000	1.98
+++ Css3Style.java	3 Oct 2012 10:21:22 -0000	1.99
@@ -63,6 +63,7 @@
 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.CssTransitionProperty;
 import org.w3c.css.properties.css.CssWordBreak;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.Util;
@@ -141,6 +142,7 @@
 
 	public CssTransitionDelay cssTransitionDelay;
 	public CssTransitionDuration cssTransitionDuration;
+	public CssTransitionProperty cssTransitionProperty;
 	
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
@@ -1091,6 +1093,14 @@
 		return cssTransitionDuration;
 	}
 
+	public CssTransitionProperty getTransitionProperty() {
+		if (cssTransitionProperty == null) {
+			cssTransitionProperty =
+					(CssTransitionProperty) style.CascadingOrder(
+							new CssTransitionProperty(), style, selector);
+		}
+		return cssTransitionProperty;
+	}
 	///
 
 	/**

--- NEW FILE: CssTransitionProperty.java ---
// $Id: CssTransitionProperty.java,v 1.1 2012/10/03 10:21:22 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-property
 */
public class CssTransitionProperty extends org.w3c.css.properties.css.CssTransitionProperty {

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

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

		CssValue val;
		char op;
		ArrayList<CssValue> values = new ArrayList<CssValue>();
		boolean singleVal = false;
		CssValue sValue = null;

		while (!expression.end()) {
			val = expression.getValue();
			op = expression.getOperator();
			switch (val.getType()) {
				case CssTypes.CSS_IDENT:
					if (inherit.equals(val)) {
						singleVal = true;
						sValue = inherit;
						values.add(inherit);
					} else if (none.equals(val)) {
						singleVal = true;
						sValue = none;
						values.add(none);
					} else {
						// TOTO check it's an existing property
						values.add(val);
					}
					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 (singleVal && values.size() > 1) {
			throw new InvalidParamException("value",
					sValue.toString(),
					getPropertyName(), ac);
		}
		value = (values.size() == 1) ? values.get(0) : new CssLayerList(values);
	}

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

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