2002/css-validator/org/w3c/css/properties/css3 CssBoxDecorationBreak.java,NONE,1.1 Css3Style.java,1.17,1.18 CssBoxShadow.java,1.7,1.8

Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv26168/w3c/css/properties/css3

Modified Files:
	Css3Style.java CssBoxShadow.java 
Added Files:
	CssBoxDecorationBreak.java 
Log Message:
added box-decoration-break from http://www.w3.org/TR/2012/WD-css3-background-20120214/#box-decoration-break

--- NEW FILE: CssBoxDecorationBreak.java ---
// $Id: CssBoxDecorationBreak.java,v 1.1 2012/04/05 09:42:21 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
// Rewritten 2012 by Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT 1995-2012  World Wide Web Consortium (MIT, ERCIM, Keio University)
// 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.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.CssTypes;
import org.w3c.css.values.CssValue;

/**
 * @spec http://www.w3.org/TR/2012/WD-css3-background-20120214/#the-box-decoration-break
 */

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

    public static CssIdent slice;
    public static CssIdent clone;

    CssIdent value;

    static {
        slice = CssIdent.getIdent("slice");
        clone = CssIdent.getIdent("clone");
    }

    /**
     * Create new CssBoxDecorationBreak
     */
    public CssBoxDecorationBreak() {
        value = slice;
    }

    /**
     * Create new CssBoxDecorationBreak
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Values are incorrect
     */
    public CssBoxDecorationBreak(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 if (slice.equals(val)) {
            value = slice;
        } else if (clone.equals(val)) {
            value = clone;
        } else {
            throw new InvalidParamException("value",
                    expression.getValue(),
                    getPropertyName(), ac);
        }
        expression.next();
    }


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

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBoxDecorationBreak &&
                value.equals(((CssBoxDecorationBreak) property).value));
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
        return value;
    }

    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
        return (inherit == value);
    }

    /**
     * Returns a string representation of the object
     */
    public String toString() {
        return value.toString();
    }

    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
        return slice == value;
    }
}

Index: CssBoxShadow.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssBoxShadow.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- CssBoxShadow.java	4 Apr 2012 14:53:14 -0000	1.7
+++ CssBoxShadow.java	5 Apr 2012 09:42:21 -0000	1.8
@@ -58,7 +58,7 @@
 
         setByUser();
         CssValue val = expression.getValue();
-        char op = expression.getOperator();
+        char op;
 
         if (expression.getCount() == 1) {
             // it can be only 'none' or 'inherit'

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Css3Style.java	4 Apr 2012 13:58:57 -0000	1.17
+++ Css3Style.java	5 Apr 2012 09:42:20 -0000	1.18
@@ -28,6 +28,7 @@
 import org.w3c.css.properties.css.CssColumns;
 import org.w3c.css.properties.css.CssOpacity;
 import org.w3c.css.properties.css.CssBoxShadow;
+import org.w3c.css.properties.css.CssBoxDecorationBreak;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.Util;
 import org.w3c.css.util.Warning;
@@ -144,6 +145,7 @@
     public CssBreakBefore cssBreakBefore;
     public CssBreakInside cssBreakInside;
     public CssBoxShadow cssBoxShadow;
+    public CssBoxDecorationBreak cssBoxDecorationBreak;
 
     CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
     CssDropInitialAfterAlign cssDropInitialAfterAlign;
@@ -1923,6 +1925,15 @@
         return cssBoxShadow;
     }
 
+    public CssBoxDecorationBreak getBoxDecorationBreak() {
+        if (cssBoxDecorationBreak == null) {
+            cssBoxDecorationBreak =
+                    (CssBoxDecorationBreak) style.CascadingOrder(
+                            new CssBoxDecorationBreak(), style, selector);
+        }
+        return cssBoxDecorationBreak;
+    }
+
     public CssTextIndentCSS3 getTextIndentCSS3() {
         if (cssTextIndentCSS3 == null) {
             cssTextIndentCSS3 =

Received on Thursday, 5 April 2012 09:42:29 UTC