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

2002/css-validator/org/w3c/css/properties/css3 CssPerspective.java,NONE,1.1 Css3Style.java,1.124,1.125

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 12 Oct 2012 09:01:54 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1TMb7y-0006Er-LB@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv23897/css3

Modified Files:
	Css3Style.java 
Added Files:
	CssPerspective.java 
Log Message:
perspective per http://www.w3.org/TR/2012/WD-css3-transforms-20120911/#perspective

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- Css3Style.java	12 Oct 2012 08:49:04 -0000	1.124
+++ Css3Style.java	12 Oct 2012 09:01:52 -0000	1.125
@@ -71,6 +71,7 @@
 import org.w3c.css.properties.css.CssOrder;
 import org.w3c.css.properties.css.CssOverflowStyle;
 import org.w3c.css.properties.css.CssOverflowWrap;
+import org.w3c.css.properties.css.CssPerspective;
 import org.w3c.css.properties.css.CssTabSize;
 import org.w3c.css.properties.css.CssTextAlignLast;
 import org.w3c.css.properties.css.CssTextDecorationColor;
@@ -196,6 +197,7 @@
 
 	public CssTransformStyle cssTransformStyle;
 	public CssBackfaceVisibility cssBackfaceVisibility;
+	public CssPerspective cssPerspective;
 	
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
@@ -1340,7 +1342,16 @@
 		}
 		return cssBackfaceVisibility;
 	}
-	
+
+	public CssPerspective getPerspective() {
+		if (cssPerspective == null) {
+			cssPerspective =
+					(CssPerspective) style.CascadingOrder(
+							new CssPerspective(), style, selector);
+		}
+		return cssPerspective;
+	}
+
 	///
 
 	/**

--- NEW FILE: CssPerspective.java ---
// $Id: CssPerspective.java,v 1.1 2012/10/12 09:01:52 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
// Rewritten 2010 Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT 1995-2010  World Wide Web Consortium (MIT, ERCIM and Keio)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

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.CssLength;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;

/**
 * @spec http://www.w3.org/TR/2012/WD-css3-transforms-20120911/#perspective
 */

public class CssPerspective extends org.w3c.css.properties.css.CssPerspective {


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

    /**
     * Create a new CssPerspective
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Incorrect value
     */
    public CssPerspective(ApplContext ac, CssExpression expression,
						  boolean check) throws InvalidParamException {

        setByUser();
        CssValue val = expression.getValue();

        if (check && expression.getCount() > 1) {
            throw new InvalidParamException("unrecognize", ac);
        }

        switch (val.getType()) {
            case CssTypes.CSS_NUMBER:
				// number might be a length, but it will fail the >0 test
			case CssTypes.CSS_LENGTH:
				CssLength length = val.getLength();
				length.checkStrictPositiveness(ac, this);
                value = val;
                break;
            case CssTypes.CSS_IDENT:
                if (none.equals(val)) {
                    value = none;
                    break;
                }
                if (inherit.equals(val)) {
                    value = inherit;
                    break;
                }
            default:
                throw new InvalidParamException("value", expression.getValue(),
                        getPropertyName(), ac);
        }
        expression.next();
    }

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

    /**
     * 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 (value == none) || (value == initial);
    }
}
Received on Friday, 12 October 2012 09:02:00 UTC

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