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

2002/css-validator/org/w3c/css/properties/css3 CssBackfaceVisibility.java,NONE,1.1 CssTransformStyle.java,NONE,1.1 Css3Style.java,1.123,1.124

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 12 Oct 2012 08:49:13 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1TMavh-0005P8-1U@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv20498/css3

Modified Files:
	Css3Style.java 
Added Files:
	CssBackfaceVisibility.java CssTransformStyle.java 
Log Message:
backface-visibility and transform-style from http://www.w3.org/TR/2012/WD-css3-transforms-20120911/

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- Css3Style.java	11 Oct 2012 13:17:37 -0000	1.123
+++ Css3Style.java	12 Oct 2012 08:49:04 -0000	1.124
@@ -23,6 +23,7 @@
 import org.w3c.css.properties.css.CssAnimationName;
 import org.w3c.css.properties.css.CssAnimationPlayState;
 import org.w3c.css.properties.css.CssAnimationTimingFunction;
+import org.w3c.css.properties.css.CssBackfaceVisibility;
 import org.w3c.css.properties.css.CssBackgroundClip;
 import org.w3c.css.properties.css.CssBackgroundOrigin;
 import org.w3c.css.properties.css.CssBackgroundSize;
@@ -82,6 +83,7 @@
 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.CssTransformStyle;
 import org.w3c.css.properties.css.CssTransition;
 import org.w3c.css.properties.css.CssTransitionDelay;
 import org.w3c.css.properties.css.CssTransitionDuration;
@@ -192,6 +194,9 @@
 	public CssJustifyContent cssJustifyContent;
 	public CssOrder cssOrder;
 
+	public CssTransformStyle cssTransformStyle;
+	public CssBackfaceVisibility cssBackfaceVisibility;
+	
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
 	CssDropInitialBeforeAdjust cssDropInitialBeforeAdjust;
@@ -1318,6 +1323,24 @@
 		return cssOrder;
 	}
 
+	public CssTransformStyle getTransformStyle() {
+		if (cssTransformStyle == null) {
+			cssTransformStyle =
+					(CssTransformStyle) style.CascadingOrder(
+							new CssTransformStyle(), style, selector);
+		}
+		return cssTransformStyle;
+	}
+
+	public CssBackfaceVisibility getBackfaceVisibility() {
+		if (cssBackfaceVisibility == null) {
+			cssBackfaceVisibility =
+					(CssBackfaceVisibility) style.CascadingOrder(
+							new CssBackfaceVisibility(), style, selector);
+		}
+		return cssBackfaceVisibility;
+	}
+	
 	///
 
 	/**

--- NEW FILE: CssTransformStyle.java ---
// $Id: CssTransformStyle.java,v 1.1 2012/10/12 08:49:09 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.CssIdent;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;

/**
 * @spec http://www.w3.org/TR/2012/WD-css3-transforms-20120911/#transform-style
 */
public class CssTransformStyle extends org.w3c.css.properties.css.CssTransformStyle {

	private static CssIdent[] allowed_values;

	static {
		String id_values[] = {"flat", "preserve-3d"};
		allowed_values = new CssIdent[id_values.length];
		int i = 0;
		for (String s : id_values) {
			allowed_values[i++] = CssIdent.getIdent(s);
		}
	}

	public static CssIdent getMatchingIdent(CssIdent ident) {
		for (CssIdent id : allowed_values) {
			if (id.equals(ident)) {
				return id;
			}
		}
		return null;
	}

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

	/**
	 * Creates a new CssTransformStyle
	 *
	 * @param expression The expression for this property
	 * @throws org.w3c.css.util.InvalidParamException
	 *          Expressions are incorrect
	 */
	public CssTransformStyle(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 = getMatchingIdent((CssIdent) val);
			if (val == null) {
				throw new InvalidParamException("value",
						expression.getValue(),
						getPropertyName(), ac);
			}
			value = val;
		}
		expression.next();
	}

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

}


--- NEW FILE: CssBackfaceVisibility.java ---
// $Id: CssBackfaceVisibility.java,v 1.1 2012/10/12 08:49:05 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.CssIdent;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;

/**
 * @spec http://www.w3.org/TR/2012/WD-css3-transforms-20120911/#backface-visibility
 */
public class CssBackfaceVisibility extends org.w3c.css.properties.css.CssBackfaceVisibility {

	private static CssIdent[] allowed_values;

	static {
		String id_values[] = {"visible", "hidden"};
		allowed_values = new CssIdent[id_values.length];
		int i = 0;
		for (String s : id_values) {
			allowed_values[i++] = CssIdent.getIdent(s);
		}
	}

	public static CssIdent getMatchingIdent(CssIdent ident) {
		for (CssIdent id : allowed_values) {
			if (id.equals(ident)) {
				return id;
			}
		}
		return null;
	}

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

	/**
	 * Creates a new CssBackfaceVisibility
	 *
	 * @param expression The expression for this property
	 * @throws org.w3c.css.util.InvalidParamException
	 *          Expressions are incorrect
	 */
	public CssBackfaceVisibility(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 = getMatchingIdent((CssIdent) val);
			if (val == null) {
				throw new InvalidParamException("value",
						expression.getValue(),
						getPropertyName(), ac);
			}
			value = val;
		}
		expression.next();
	}

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

}
Received on Friday, 12 October 2012 08:49:17 UTC

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