2002/css-validator/org/w3c/css/properties/css3 CSS3Default.properties,NONE,1.1 Css3Properties.java,NONE,1.1 Css3Property.java,NONE,1.1 Css3Style.java,NONE,1.1 CssAlignmentAdjust.java,NONE,1.1 CssAlignmentBaseLine.java,NONE,1.1 CssAllSpaceTreatment.java,NONE,1.1 CssAppearance.java,NONE,1.1 CssBackgroundClip.java,NONE,1.1 CssBackgroundOrigin.java,NONE,1.1 CssBackgroundQuantity.java,NONE,1.1 CssBackgroundSize.java,NONE,1.1 CssBackgroundSpacing.java,NONE,1.1 CssBaselineShift.java,NONE,1.1 CssBlockProgression.java,NONE,1.1 CssBorderBottomFitLength.java,NONE,1.1 CssBorderBottomFitWidth.java,NONE,1.1 CssBorderBottomImage.java,NONE,1.1 CssBorderBottomLeftFitLength.java,NONE,1.1 CssBorderBottomLeftFitWidth.java,NONE,1.1 CssBorderBottomLeftImage.java,NONE,1.1 CssBorderBottomLeftRadius.java,NONE,1.1 CssBorderBottomRightFitLength.java,NONE,1.1 CssBorderBottomRightFitWidth.java,NONE,1.1 CssBorderBottomRightImage.java,NONE,1.1 CssBorderBottomRightRadius.java,NONE,1.1 CssBorderBreak.java,NONE,1.1 CssBorderCornerF

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

Added Files:
	CSS3Default.properties Css3Properties.java Css3Property.java 
	Css3Style.java CssAlignmentAdjust.java 
	CssAlignmentBaseLine.java CssAllSpaceTreatment.java 
	CssAppearance.java CssBackgroundClip.java 
	CssBackgroundOrigin.java CssBackgroundQuantity.java 
	CssBackgroundSize.java CssBackgroundSpacing.java 
	CssBaselineShift.java CssBlockProgression.java 
	CssBorderBottomFitLength.java CssBorderBottomFitWidth.java 
	CssBorderBottomImage.java CssBorderBottomLeftFitLength.java 
	CssBorderBottomLeftFitWidth.java CssBorderBottomLeftImage.java 
	CssBorderBottomLeftRadius.java 
	CssBorderBottomRightFitLength.java 
	CssBorderBottomRightFitWidth.java 
	CssBorderBottomRightImage.java CssBorderBottomRightRadius.java 
	CssBorderBreak.java CssBorderCornerFit.java 
	CssBorderCornerImage.java CssBorderFit.java 
	CssBorderFitLength.java CssBorderFitWidth.java 
	CssBorderImage.java CssBorderImageTransform.java 
	CssBorderLeftFitLength.java CssBorderLeftFitWidth.java 
	CssBorderLeftImage.java CssBorderRadius.java 
	CssBorderRightFitLength.java CssBorderRightFitWidth.java 
	CssBorderRightImage.java CssBorderTopFitLength.java 
	CssBorderTopFitWidth.java CssBorderTopImage.java 
	CssBorderTopLeftFitLength.java CssBorderTopLeftFitWidth.java 
	CssBorderTopLeftImage.java CssBorderTopLeftRadius.java 
	CssBorderTopRightFitLength.java CssBorderTopRightFitWidth.java 
	CssBorderTopRightImage.java CssBorderTopRightRadius.java 
	CssBoxHeight.java CssBoxShadow.java CssBoxSizing.java 
	CssBoxWidth.java CssClearAfter.java CssClearCSS3.java 
	CssCollapse.java CssColorProfile.java CssColumnCount.java 
	CssColumnGap.java CssColumnPadding.java CssColumnRule.java 
	CssColumnRuleColor.java CssColumnRuleStyle.java 
	CssColumnRuleWidth.java CssColumnSpaceDistribution.java 
	CssColumnSpan.java CssColumnWidth.java CssColumnWidthPol.java 
	CssCrop.java CssDisplayModel.java CssDisplayRole.java 
	CssDominantBaseLine.java CssDropInitialAfterAdjust.java 
	CssDropInitialAfterAlign.java CssDropInitialBeforeAdjust.java 
	CssDropInitialBeforeAlign.java CssDropInitialSize.java 
	CssDropInitialValue.java CssFit.java CssFitPosition.java 
	CssFloatCSS3.java CssFloatDisplace.java CssFontEffect.java 
	CssFontEmphasize.java CssFontEmphasizePos.java 
	CssFontEmphasizeStyle.java CssFontSmooth.java CssGlyphHor.java 
	CssGlyphOrVert.java CssGroupReset.java 
	CssHangingPunctuation.java CssHeightCSS3.java CssIcon.java 
	CssIndentEdgeReset.java CssInlineBoxAlign.java 
	CssKerningMode.java CssKerningPairTreshold.java CssKeyEq.java 
	CssLineBoxContain.java CssLineBreak.java CssLineGrid.java 
	CssLineGridMode.java CssLineGridProgression.java 
	CssLineHeightPolicy.java CssLineStacking.java 
	CssLineStackingRuby.java CssLineStackingShift.java 
	CssLineStackingStrategy.java CssLinefeedTreatment.java 
	CssLink.java CssLinkBehavior.java CssMarginInside.java 
	CssMarginOutside.java CssMarquee.java CssMarqueeDirection.java 
	CssMarqueeRepetition.java CssMarqueeSpeed.java 
	CssMarqueeStyle.java CssMaxFontSize.java CssMaxHeightCSS3.java 
	CssMaxWidthCSS3.java CssMedia.java CssMinFontSize.java 
	CssMinHeightCSS3.java CssMinWidthCSS3.java CssNavDown.java 
	CssNavIndex.java CssNavLeft.java CssNavRight.java 
	CssNavUp.java CssOpacity.java CssOutlineOffset.java 
	CssOverflowCSS3.java CssOverflowClip.java CssOverflowX.java 
	CssOverflowY.java CssPaddingBottomCSS3.java 
	CssPaddingCSS3.java CssPaddingLeftCSS3.java 
	CssPaddingRightCSS3.java CssPaddingSideCSS3.java 
	CssPaddingTopCSS3.java CssPunctuationTrim.java 
	CssRenderIntent.java CssResizer.java CssRubyAlign.java 
	CssRubyOverhang.java CssRubyPosition.java CssRubySpan.java 
	CssScript.java CssTabIndex.java CssTextAfterOverflow.java 
	CssTextAlignLast.java CssTextAutoSpace.java CssTextBlink.java 
	CssTextCombine.java CssTextDecorationCSS3.java 
	CssTextEndOverflow.java CssTextHeight.java 
	CssTextIndentCSS3.java CssTextJustify.java 
	CssTextJustifyTrim.java CssTextKashidaSpace.java 
	CssTextLTColor.java CssTextLTMode.java CssTextLTStyle.java 
	CssTextLineThrough.java CssTextOLColor.java CssTextOLMode.java 
	CssTextOLStyle.java CssTextOverLine.java CssTextOverflow.java 
	CssTextOverflowEllipsis.java CssTextOverflowMode.java 
	CssTextPropertiesConstantsCSS3.java CssTextSpace.java 
	CssTextUlColor.java CssTextUlMode.java CssTextUlPos.java 
	CssTextUlStyle.java CssTextUnderLine.java CssToggleGroup.java 
	CssUserFocus.java CssUserFocusKey.java 
	CssUserFocusPointer.java CssUserInput.java CssUserModify.java 
	CssUserSelect.java CssVisibilityCSS3.java 
	CssWhiteSpaceCSS3.java CssWhiteSpaceTreatment.java 
	CssWidthCSS3.java CssWordBreak.java CssWordBreakCJK.java 
	CssWordBreakInside.java CssWordSpacingCSS3.java 
	CssWrapOption.java CssWritingMode.java MediaColor.java 
	MediaColorIndex.java MediaDeviceAspectRatio.java 
	MediaDeviceHeight.java MediaDeviceWidth.java MediaGrid.java 
	MediaHeight.java MediaMaxColor.java MediaMaxColorIndex.java 
	MediaMaxDeviceAspectRatio.java MediaMaxDeviceHeight.java 
	MediaMaxDeviceWidth.java MediaMaxHeight.java 
	MediaMaxMonochrome.java MediaMaxResolution.java 
	MediaMaxWidth.java MediaMinColor.java MediaMinColorIndex.java 
	MediaMinDeviceAspectRatio.java MediaMinDeviceHeight.java 
	MediaMinDeviceWidth.java MediaMinHeight.java 
	MediaMinMonochrome.java MediaMinResolution.java 
	MediaMinWidth.java MediaMonochrome.java MediaResolution.java 
	MediaScan.java MediaWidth.java 
Log Message:
Patch by Jean-Guilhem Rouel

Better handling of media and properties files
Major reorganization of those properties files



--- NEW FILE: MediaMinWidth.java ---
//
// $Id: MediaMinWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMinWidth.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:01:44  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMinWidth extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMinWidth
     */
    public MediaMinWidth() {
		//empty
    }

    /**
     * Create a new MediaMinWidth.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMinWidth(ApplContext ac, CssExpression expression, 
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaMinWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }

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

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-width";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMinWidth != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMinWidth = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMinWidth();
	} else {
	    return ((Css3Style) style).mediaMinWidth;
	}
    }

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

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

}

--- NEW FILE: CssBorderBottomLeftImage.java ---
//
// $Id: CssBorderBottomLeftImage.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;



public class CssBorderBottomLeftImage extends CssProperty {
    
    String value = "";
    ApplContext ac;
    CssIdent contin = new CssIdent("continue");
    CssIdent none = new CssIdent("none");
    
    /**
     * Create new CssBorderBottomLeftImage
     */
    public CssBorderBottomLeftImage() {
	value = "continue";
    }
    
    /**
     * Create new CssBorderBottomLeftImage
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderBottomLeftImage(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val != null) {
	    if (val.equals(none)) {
		value = "none";
	    } else if (val.equals(contin)) {
		value = "continue";
	    } else if (val instanceof CssURL) {
		value = val.toString();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	expression.next();
    }
    
    public CssBorderBottomLeftImage(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomLeftImage != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomLeftImage = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomLeftImage();
	} else {
	    return ((Css3Style) style).cssBorderBottomLeftImage;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomLeftImage &&
		value.equals( ((CssBorderBottomLeftImage) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-left-image";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }

}

--- NEW FILE: MediaResolution.java ---
//
// $Id: MediaResolution.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaResolution.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:01:44  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssResolution;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaResolution extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaResolution
     */
    public MediaResolution() {
		//empty
    }

    /**
     * Create a new MediaResolution.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaResolution(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssResolution) {
		value = val;
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaResolution(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }

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

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "resolution";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaResolution != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaResolution = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaResolution();
	} else {
	    return ((Css3Style) style).mediaResolution;
	}
    }

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

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

}

--- NEW FILE: CssBorderImage.java ---
//
// $Id: CssBorderImage.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;



public class CssBorderImage extends CssProperty {
    
    String value = "";
    ApplContext ac;
    CssIdent none = new CssIdent("none");
    
    /**
     * Create new CssBorderImage
     */
    public CssBorderImage() {
	value = "none";
    }
    
    /**
     * Create new CssBorderImage
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderImage(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = null;
	
	if (!(expression.getCount() <= 4)) {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	for (int i=0; i < expression.getCount(); i++) {
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		
		if (val.equals(none)) {
		    value += "none" + " ";
		} else if (val instanceof CssURL) {
		    value += val.toString() + " ";
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
		
	    } else {
		break;
	    }
	    
	    expression.next();
	}
	
	value = value.trim();
    }
    
    public CssBorderImage(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderImage != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderImage = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderImage();
	} else {
	    return ((Css3Style) style).cssBorderImage;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderImage &&
		value.equals( ((CssBorderImage) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-image";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }

}

--- NEW FILE: CssBorderBottomRightFitLength.java ---
//
// $Id: CssBorderBottomRightFitLength.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderBottomRightFitLength extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderBottomRightFitLength
     */
    public CssBorderBottomRightFitLength() {
	value = "overwrite";
    }
    
    /**
     * Create a new CssBorderBottomRightFitLength
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderBottomRightFitLength(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderBottomRightFitLength(ApplContext ac,
	    CssExpression expression) throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomRightFitLength != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomRightFitLength = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomRightFitLength();
	}
	else {
	    return ((Css3Style) style).cssBorderBottomRightFitLength;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomRightFitLength &&
		value.equals(((CssBorderBottomRightFitLength) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-right-fit-length";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("overwrite");
    }
    
}

--- NEW FILE: CssTextAutoSpace.java ---
//
// $Id: CssTextAutoSpace.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || ideograph-numeric || ideograph-alpha || 
 *  ideograph-space || ideograph-parenthesis || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  When a run of non-ideographic or numeric characters appears inside of 
 *  ideographic text, a certain amount of space is often preferred on both 
 *  sides of the non-ideographic text to separate it from the surrounding
 *  ideographic glyphs. This property controls the creation of that space when 
 *  rendering the text. That added width does not correspond to the insertion 
 *  of additional space characters, but instead to the width increment of
 *  existing glyphs. 
 */

public class CssTextAutoSpace extends CssProperty {
 
    CssValue textautospace;
    ApplContext ac;

    static CssIdent none = new CssIdent("none");

    private static String[] values = {
	"none", "ideograph-numeric", "ideograph-alpha", 
	"ideograph-space", "ideograph-parenthesis", "inherit"
    };

    /**
     * Create a new CssTextAutoSpace
     */
    public CssTextAutoSpace() {
	textautospace = none;
    }

    /**
     * Create a new CssTextAutoSpace
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextAutoSpace(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	int i = 0;
	for (;i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		textautospace = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", 
					    expression.getValue(), 
					    getPropertyName(), ac);
	}

    }

    public CssTextAutoSpace(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextAutoSpace != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextAutoSpace = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextAutoSpace();
	}
	else {
	    return ((Css3Style) style).cssTextAutoSpace;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextAutoSpace &&
		textautospace.equals(((CssTextAutoSpace) property).textautospace));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-autospace";
    }

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

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

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

    /**
     * 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 textautospace == none;
    }

}

--- NEW FILE: CssBorderBottomRightRadius.java ---
//
// $Id: CssBorderBottomRightRadius.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssValue;

public class CssBorderBottomRightRadius extends CssProperty {

    String value;
    ApplContext ac;
    
    /**
     * Create new CssBorderBottomRightRadius
     */
    public CssBorderBottomRightRadius() {
	CssNumber cssnum =  new CssNumber((float) 1.0);
	value = cssnum.toString();
    }
    
    /**
     * Create new CssBorderBottomRightRadius
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderBottomRightRadius(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssLength) {
	    value = val.toString();
	    expression.next();
	    
	    val = expression.getValue();
	    if (val != null) {
		
		if (val instanceof CssLength) {
		    value += " " + val.toString();
		    expression.next();
		} else {
		    throw new InvalidParamException("value", 
			    expression.getValue(), getPropertyName(), ac);
		}
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBorderBottomRightRadius(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomRightRadius != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomRightRadius = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomRightRadius();
	} else {
	    return ((Css3Style) style).cssBorderBottomRightRadius;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomRightRadius &&
		value.equals( ((CssBorderBottomRightRadius) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-right-radius";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: CssPaddingRightCSS3.java ---
//
// $Id: CssPaddingRightCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssPaddingRightCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/12/24 13:20:53  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:00  plehegar
 * Freeze
 *
 * Revision 1.4  1997/08/20 11:41:27  plehegar
 * Freeze
 *
 * Revision 1.3  1997/08/06 17:30:16  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:20:16  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/24 01:29:32  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'padding-right'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> &lt;length&gt; | &lt;percentage&gt;<BR>
 *   <EM>Initial:</EM> 0<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> refer to parent element's width<BR>
 *   <P>
 *   This property sets the right padding of an element.
 *   <PRE>
 *   BLOCKQUOTE { padding-right: 10px }
 * </PRE>
 *   <P>
 *   Padding values cannot be negative.
 *
 * @version $Revision: 1.1 $
 */
public class CssPaddingRightCSS3 extends CssPaddingSideCSS3 {
    
    /**
     * Create a new CssPaddingRightCSS3
     */
    public CssPaddingRightCSS3() {
	super();
    }
    
    /**
     * Create a new CssPaddingRightCSS3 with an another CssPaddingSideCSS3
     *
     * @param another The another side
     */
    public CssPaddingRightCSS3(CssPaddingSideCSS3 another) {
	super(another);
    }
    
    /**
     * Create a new CssPaddingRightCSS3
     *
     * @param expression The expression for this property.
     * @exception InvalidParamException Values are incorrect
     */
    public CssPaddingRightCSS3(ApplContext ac, CssExpression expression,
	    boolean check)
    throws InvalidParamException {
	super(ac, expression, check);
    }
    
    public CssPaddingRightCSS3(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "padding-right";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssPaddingRightCSS3 != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssPaddingRightCSS3 = this;
	
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getPaddingRightCSS3();
	} else {
	    return ((Css3Style) style).cssPaddingCSS3.getRight();
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssPaddingRightCSS3 &&
		value.equals(((CssPaddingRightCSS3) property).value));
    }
    
}

--- NEW FILE: CssColumnRuleStyle.java ---
//
// $Id: CssColumnRuleStyle.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssBorderStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;border-style&gt; || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssColumnRuleStyle extends CssProperty {

    CssBorderStyle value;

    /**
     * Create a new CssColumnRuleStyle
     */
    public CssColumnRuleStyle() {
	// nothing to do
    }

    /**
     * Create a new CssColumnRuleStyle
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssColumnRuleStyle(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	try {
	    value = new CssBorderStyle(ac, expression);
	    expression.next();
	}
	catch (InvalidParamException e) {
	    throw new InvalidParamException("value",
					    expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssColumnRuleStyle(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssColumnRuleStyle != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssColumnRuleStyle = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getColumnRuleStyle();
	}
	else {
	    return ((Css3Style) style).cssColumnRuleStyle;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "column-border-style";
    }

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

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

    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return false;
    }

}

--- NEW FILE: CssTextOLMode.java ---
//
// $Id: CssTextOLMode.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM>  continuous || skipwhitespace || inherit<BR>
 *  <EM>Initial:</EM>continuous<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies the mode for the overline, that is whether the
 *  overline is continuous or whether it appears only under skipwhitespace and not
 *  whitespace.
 */

public class CssTextOLMode extends CssProperty {

    CssValue olmode;

    static CssIdent continuous = new CssIdent("continuous");
    static CssIdent skipwhitespace = new CssIdent("skip-white-space");

    /**
     * Create a new CssTextOLMode
     */
    public CssTextOLMode() {
	olmode = continuous;
    }

    /**
     * Create a new CssTextOLMode
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextOLMode(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(continuous)) {
	    olmode = continuous;
	    expression.next();
	}
	else if (val.equals(skipwhitespace)) {
	    olmode = skipwhitespace;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    olmode = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value",
					    expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextOLMode(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextOLMode != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextOLMode = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextOLMode();
	}
	else {
	    return ((Css3Style) style).cssTextOLMode;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-overline-mode";
    }

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

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

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

    /**
     * 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 olmode == continuous;
    }

}

--- NEW FILE: CssTextLineThrough.java ---
//
// $Id: CssTextLineThrough.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;style&gt; || &lt;color&gt; || &lt;mode&gt; || 
 *  &lt;position&gt; || inherit<BR>
 *  <EM>Initial:</EM>not defined for shorthand properties<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property is the shorthand for 'text-line-through-style', 
 *  'text-line-through-color' and 'text-line-through-mode'.
 */

public class CssTextLineThrough extends CssProperty 
implements CssOperator {
 
    CssValue linethrough;
    CssTextLTStyle tls;
    CssTextLTColor tlc;
    CssTextLTMode tlm;

    /**
     * Create a new CssTextLineThrough
     */
    public CssTextLineThrough() {
    }

    /**
     * Create a new CssTextLineThrough
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextLineThrough(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	CssValue val = expression.getValue();
	int maxvalues = 3;
	boolean correct = true;
	char op = SPACE;

	while (correct && (val != null) && (maxvalues -- > 0)) {

	    correct = false;

	    if (tls == null) {
		try {
		    tls = new CssTextLTStyle(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && tlc == null) {
		try {
		    tlc = new CssTextLTColor(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && tlm == null) {
		try {
		    tlm = new CssTextLTMode(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct) {
		throw new InvalidParamException("value", 
						expression.getValue(), 
						getPropertyName(), ac);
	    }

	val = expression.getValue();
	op = expression.getOperator();
	
	}

	if (tls == null) {
	    tls = new CssTextLTStyle();
	}
	if (tlc == null) {
	    tlc = new CssTextLTColor();
	}
	if (tlm == null) {
	    tlm = new CssTextLTMode();
	}

    }

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

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextLineThrough != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextLineThrough = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextLineThrough();
	}
	else {
	    return ((Css3Style) style).cssTextLineThrough;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return false;
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-line-through";
    }

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	
	String ret = "";

	if (tls.isByUser()) {
	    ret += " " + tls;
	}
	if (tlc.isByUser()) {
	    ret += " " + tlc;
	}
	if (tlm.isByUser()) {
	    ret += " " + tlc;
	}
	return ret.substring(1);

    }
}

--- NEW FILE: MediaColorIndex.java ---
//
// $Id: MediaColorIndex.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaColorIndex.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:05:40  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaColorIndex extends CssProperty implements CssOperator {

    CssValue value;

    /**
     * Create a new MediaColorIndex
     */
    public MediaColorIndex() {
		//empty
    }

    /**
     * Create a new MediaColorIndex.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaColorIndex(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	//char op = SPACE;
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaColorIndex(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "color-index";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaColorIndex != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaColorIndex = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaColorIndex();
	} else {
	    return ((Css3Style) style).mediaColorIndex;
	}
    }

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

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

}

--- NEW FILE: CssBorderLeftFitLength.java ---
//
// $Id: CssBorderLeftFitLength.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderLeftFitLength extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderLeftFitLength
     */
    public CssBorderLeftFitLength() {
	value = "repeat";
    }
    
    /**
     * Create a new CssBorderLeftFitLength
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderLeftFitLength(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderLeftFitLength(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderLeftFitLength != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderLeftFitLength = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderLeftFitLength();
	}
	else {
	    return ((Css3Style) style).cssBorderLeftFitLength;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderLeftFitLength &&
		value.equals(((CssBorderLeftFitLength) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-left-fit-length";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }
    
}

--- NEW FILE: CssBorderFit.java ---
//
// $Id: CssBorderFit.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderFit extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderFit
     */
    public CssBorderFit() {
	value = "repeat";
    }
    
    /**
     * Create a new CssBorderFit
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderFit(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (expression.getCount() <= 2) {
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		
		for (; i < expression.getCount(); i++) {
		    
		    int j = 0;
		    for (; j < values.length; j++) {
			if (val.toString().equals(values[j])) {
			    value += val.toString() + " ";
			    expression.next();
			    break;
			}
		    }
		    
		    if (j == values.length) {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		}
	    }
	    
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
    }
    
    public CssBorderFit(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderFit != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderFit = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderFit();
	}
	else {
	    return ((Css3Style) style).cssBorderFit;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderFit &&
		value.equals(((CssBorderFit) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-fit";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }
    
}

--- NEW FILE: CssBorderBottomLeftFitLength.java ---
//
// $Id: CssBorderBottomLeftFitLength.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderBottomLeftFitLength extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderBottomLeftFitLength
     */
    public CssBorderBottomLeftFitLength() {
	value = "overwrite";
    }
    
    /**
     * Create a new CssBorderBottomLeftFitLength
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderBottomLeftFitLength(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderBottomLeftFitLength(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomLeftFitLength != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomLeftFitLength = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomLeftFitLength();
	}
	else {
	    return ((Css3Style) style).cssBorderBottomLeftFitLength;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomLeftFitLength &&
		value.equals(((CssBorderBottomLeftFitLength) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-left-fit-length";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("overwrite");
    }
    
}

--- NEW FILE: CssLineHeightPolicy.java ---
//
// $Id: CssLineHeightPolicy.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssLineHeightPolicy.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/07/19 20:30:12  sijtsche
 * files representing CSS3 properties
 *
 * Revision 1.1  2002/05/08 09:30:52  dejong
 * CSS version 3 specific properties as in March 2002, all modules
 *
 * Revision 3.1  1997/08/29 13:13:43  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:20  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:13  plehegar
 * Nothing
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *   <H4>
 *     <A NAME="clear">5.5.26 &nbsp;&nbsp; 'clear'</A>
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> none | left | right | both<BR>
 *   <EM>Initial:</EM> none<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> N/A<BR>
 *   <P> This property specifies if an element allows floating elements on its
 *   sides.  More specifically, the value of this property lists the sides where
 *   floating elements are not accepted. With 'clear' set to 'left', an element
 *   will be moved below any floating element on the left side. With 'clear' set
 *   to 'none', floating elements are allowed on all sides. Example:
 *   <PRE>
 *   H1 { clear: left }
 *  </PRE>
 *
 * @version $Revision: 1.1 $ */
public class CssLineHeightPolicy extends CssProperty {
    
    CssValue value;

    private CssIdent normal = new CssIdent("normal");
    private CssIdent stack = new CssIdent("stack");
    private CssIdent enforce = new CssIdent("enforce");
    private CssIdent snap = new CssIdent("snap");
    
    /**
     * Create a new CssLineHeightPolicy
     */
    public CssLineHeightPolicy() {
	// nothing to do
    }  
    
    /**
     * Create a new CssLineHeightPolicy
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public CssLineHeightPolicy(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();
	
	setByUser();

	if (val.equals(normal)) {
	    value = val;
	    expression.next();
	} else if (val.equals(stack)) {
	    value = val;
	    expression.next();
	} else if (val.equals(enforce)) {
	    value = val;
	    expression.next();
	} else if (val.equals(snap)) {
	    value = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(), 
					getPropertyName(), ac);
	}
    }
    
    public CssLineHeightPolicy(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "line-height-policy";
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssLineHeightPolicy != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssLineHeightPolicy = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getLineHeightPolicy();
	} else {
	    return ((Css3Style) style).cssLineHeightPolicy;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssLineHeightPolicy && 
		value == ((CssLineHeightPolicy) property).value);
    }
    
    /**
     * Is the value of this property is a default value.
     * It is used by all macro for the function <code>print</code>
     */  
    public boolean isDefault() {
	return value == normal;
    }
    
}

--- NEW FILE: CssAlignmentAdjust.java ---
//
// $Id: CssAlignmentAdjust.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || &lt;percentage&gt; || &lt;length&gt; || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>refers to the 'line-height' of the element<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'alignment-adjust' property allows more precise alignment of
 *  elements, such as graphics, that do not have a baseline-table
 *  or lack the desired baseline in their baseline-table. With the
 *  'alignment-adjust' property, the position of the baseline
 *  identified by the 'alignment-baseline' can be explicitly determined.
 */

public class CssAlignmentAdjust extends CssProperty {

    CssValue alignadjust;

    CssIdent auto = new CssIdent("auto");

    private static String[] values = {
	"auto", "baseline", "before-edge",
	"text-before-edge", "middle", "central", "after-edge", "text-after-edge",
	"ideographic", "alphabetic", "hanging", "mathematical", "inherit", "initial"
    };
    
    /**
     * Create a new CssAlignmentAdjust
     */
    public CssAlignmentAdjust() {
	alignadjust = auto;
    }
    
    /**
     * Create a new CssAlignmentAdjust
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssAlignmentAdjust(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssIdent) {
	    int i = 0;
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    alignadjust = val;
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else if (val instanceof CssPercentage) {
	    alignadjust = val;
	    expression.next();
	}
	else if (val instanceof CssLength) {
	    alignadjust = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssAlignmentAdjust(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssAlignmentAdjust != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssAlignmentAdjust = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getAlignmentAdjust();
	}
	else {
	    return ((Css3Style) style).cssAlignmentAdjust;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssAlignmentAdjust &&
		alignadjust.equals(((CssAlignmentAdjust) property).alignadjust));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "alignment-adjust";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return alignadjust;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return alignadjust.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return alignadjust.toString();
    }
    
    /**
     * 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 alignadjust == auto;
    }
    
}

--- NEW FILE: CssGroupReset.java ---
//
// $Id: CssGroupReset.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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 java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> <identifier>+ || none || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:all
 *  <P>
 *  The groups defined by the group-reset property are used as values 
 *  for the toggle-group property.
 */
public class CssGroupReset extends CssProperty {

    CssValue groupreset;
    Vector values = new Vector();

    static CssIdent none = new CssIdent("none");

    /**
     * Create a new CssGroupReset
     */
    public CssGroupReset() {
	groupreset = none;
    }

    /**
     * Create a new CssGroupReset
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssGroupReset(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	setByUser();
	CssValue val = expression.getValue();
	CssToggleGroup tg = new CssToggleGroup();
	char op = expression.getOperator();
	int counter = 0;

	if (val.equals(none)) {
	    groupreset = none;
	    expression.next();
	    return;
	}
	if (val.equals(inherit)) {
	    groupreset = inherit;
	    expression.next();
	    return;
	}
	
	while ((op == CssOperator.SPACE)
	       && (counter < expression.getCount())) {
	    
	    if (tg.groups.containsKey(val.toString())) {
		values.addElement(val.toString());
		expression.next();
		val = expression.getValue();
		op = expression.getOperator();
	    }
	    else {
		throw new InvalidParamException("nogroup", expression.getValue(),
						getPropertyName(), ac);
	    }
	    
	    counter++;
	}
    }

    public CssGroupReset(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssGroupReset != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssGroupReset = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getGroupReset();
	} else {
	    return ((Css3Style) style).cssGroupReset;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssGroupReset && 
                groupreset.equals( ((CssGroupReset) property).groupreset));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "group-reset";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return groupreset;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return groupreset.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (groupreset != null)
	    return groupreset.toString();
	else
	    return values.firstElement().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 groupreset == none;
    }
    
}	


--- NEW FILE: CssLineStacking.java ---
//
// $Id: CssLineStacking.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *
 */

public class CssLineStacking extends CssProperty
implements CssOperator {

    CssValue linegrid;
    CssLineStackingRuby lsruby;
    CssLineStackingShift lsshift;
    CssLineStackingStrategy lsstrategy;

    /**
     * Creates a new CssLineStacking
     */
    public CssLineStacking() {
    }

    /**
     * Creates a new CssLineStacking
     *
     * @param expression The expression for this property
     * @exception InvalidParamException The expression is incorrect
     */
    public CssLineStacking(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	CssValue val = expression.getValue();
	int maxvalues = 3;
	boolean correct = true;
	char op = SPACE;
	
	while (correct && (val != null) && (maxvalues-- > 0)) {
	    
	    correct = false;
	    
	    if (!correct && lsruby == null) {
		try {
		    lsruby = new CssLineStackingRuby(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    
	    if (!correct && lsshift == null) {
		try {
		    lsshift = new CssLineStackingShift(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    
	    if (!correct && lsstrategy == null) {
		try {
		    lsstrategy = new CssLineStackingStrategy(ac, expression);
		    correct = true;
		} catch (InvalidParamException e) {
		}
	    }
	    
	    if (!correct) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    val = expression.getValue();
	    op = expression.getOperator();
	    
	}
	
    }
    
    public CssLineStacking(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssLineStacking != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssLineStacking = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getLineStacking();
	}
	else {
	    return ((Css3Style) style).cssLineStacking;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "line-stacking";
    }

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

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	String ret = "";
	if (lsshift != null) {
	    ret += " " + lsshift.toString();
	}
	if (lsruby != null) {
	    ret += " " + lsruby.toString();
	}
	if (lsstrategy != null) {
		ret += " " + lsstrategy.toString();
	}
	return ret.substring(1);
    }

}

--- NEW FILE: CssDropInitialAfterAlign.java ---
//
// $Id: CssDropInitialAfterAlign.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> baseline || auto-script || before-edge ||
 *  text-before-edge || after-edge || text-after-edge || middle ||
 *  ideographic || lower || hanging || mathematical || inherit<BR>
 *  <EM>Initial:</EM>baseline<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies how an inline-level element is aligned with
 *   respect to its parent.
 */

public class CssDropInitialAfterAlign extends CssProperty {

    CssValue dropvalue;

    static CssIdent baseline = new CssIdent("baseline");

    private static String[] values = {
	"baseline", "use-script", "before-edge",
	"text-before-edge", "after-edge", "text-after-edge", "central", "middle",
	"ideographic", "alphabetic", "hanging", "mathematical", "inherit", "initial"
    };

    /**
     * Create a new CssDropInitialAfterAlign
     */
    public CssDropInitialAfterAlign() {
		dropvalue = baseline;
    }

    /**
     * Create a new CssDropInitialAfterAlign
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssDropInitialAfterAlign(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		dropvalue = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssDropInitialAfterAlign(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssDropInitialAfterAlign != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssDropInitialAfterAlign = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getDropInitialAfterAlign();
	}
	else {
	    return ((Css3Style) style).cssDropInitialAfterAlign;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "drop-initial-after-align";
    }

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

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

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

    /**
     * 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 (dropvalue == baseline);
    }

}

--- NEW FILE: CssFontEmphasizePos.java ---
//
// $Id: CssFontEmphasizePos.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> before || after || inherit<BR>
 *  <EM>Initial:</EM>before<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property sets the position of the emphasis symbols. They can appear 
 *  either 'before' or 'after' the emphasized run of horizontal text. 
 *  The values 'before' and 'after' should be understood as relative to the 
 *  line baseline. In an horizontal layout flow, 'before' means above the text. 
 *  In a vertical layout flow, if the position is set to 'before' then the 
 *  emphasis marks should appear on the right side of the vertical text column.
 *  If the position is set to 'after', then the emphasis should appear the the 
 *  left side of the column.  
 *  <PRE>
 *  H1 { font-emphasize-position: before}
 *  </PRE>
 */

public class CssFontEmphasizePos extends CssProperty {
    
    CssValue emppos;
    ApplContext ac;

    static CssIdent before = new CssIdent("before");
    static CssIdent after = new CssIdent("after");

    /**
     * Create new CssFontEmphasizePos
     */
    public CssFontEmphasizePos() {
	emppos = before;
    }

    /** 
     * Create new CssFontEmphasizePos
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssFontEmphasizePos(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(before)) {
	    emppos = before;
	    expression.next();
	}
	else if (val.equals(after)) {
	    emppos = before;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					getPropertyName(), ac);
	}
    }
    
    public CssFontEmphasizePos(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssFontEmphasizePos != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssFontEmphasizePos = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getFontEmphasizePos();
	} else {
	    return ((Css3Style) style).cssFontEmphasizePos;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssFontEmphasizePos && 
                emppos.equals( ((CssFontEmphasizePos) property).emppos));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "font-emphasize-position";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return emppos;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return emppos.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return emppos.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 emppos == before;
    }
    
}	

--- NEW FILE: CssMarginOutside.java ---
//
// $Id: CssMarginOutside.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssMarginOutside.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/07/19 20:30:12  sijtsche
 * files representing CSS3 properties
 *
 * Revision 1.1  2002/05/08 09:30:52  dejong
 * CSS version 3 specific properties as in March 2002, all modules
 *
 * Revision 3.1  1997/08/29 13:13:56  plehegar
 * Freeze
 *
 * Revision 1.4  1997/08/20 11:41:26  plehegar
 * Freeze
 *
 * Revision 1.3  1997/08/06 17:30:12  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:20:11  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/24 00:08:48  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssMarginSide;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'margin-outside'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> &lt;length&gt; | &lt;percentage&gt; | auto<BR>
 *   <EM>Initial:</EM> 0<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> refer to parent element's width<BR>
 *   <P>
 *   This property sets the right margin of an element:
 *   <PRE>
 *   H1 { margin-outside: 12.3% }
 * </PRE>
 *   <P> A negative value is allowed, but there may be implementation-specific
 *   limits.
 *
 * @version $Revision: 1.1 $ */
public class CssMarginOutside extends CssMarginSide {

  /**
   * Create a new CssMarginOutside
   */
  public CssMarginOutside() {
    super();
  }
  
  /**
   * Create a new CssMarginOutside with an another CssMarginSide
   * @param another The another side.
   */
  public CssMarginOutside(CssMarginSide another) {
    super(another);
  }
  
  /**
   * Create a new CssMarginOutside
   *
   * @param expression The expression for this property.
   * @exception InvalidParamException Values are incorrect
   */
  public CssMarginOutside(ApplContext ac, CssExpression expression,
	  boolean check) throws InvalidParamException {
    super(ac, expression, check);
  }
  
  public CssMarginOutside(ApplContext ac, CssExpression expression)
	throws InvalidParamException {
    this(ac, expression, false);
  }  
  
  /**
   * Returns the name of this property
   */  
  public String getPropertyName() {
    return "margin-outside";
  }

  /**
   * Add this property to the CssStyle.
   *
   * @param style The CssStyle
   */
  public void addToStyle(ApplContext ac, CssStyle style) {
    Css3Style style0 = (Css3Style) style;
    if (style0.cssMarginOutside != null)
      style0.addRedefinitionWarning(ac, this);
    style0.cssMarginOutside = this;
  }

  /**
   * Get this property in the style.
   *
   * @param style The style where the property is
   * @param resolve if true, resolve the style to find this property
   */  
  public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
    if (resolve) {
      return ((Css3Style) style).getMarginOutside();
    } else {
      return ((Css3Style) style).cssMarginOutside;
    }
  }

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

}

--- NEW FILE: CssOpacity.java ---
//
// $Id: CssOpacity.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.util.Util;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt; alphavalue&gt; || inherit<BR>
 *  <EM>Initial:</EM>1<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property sets the opacity of an element.
 *  <PRE>
 *  H1 { opacity: 0}
 *  </PRE>
 */

public class CssOpacity extends CssProperty implements CssOperator {
    
    String opaclevel;
    ApplContext ac;
    
    
    /**
     * Create a new CssOpacity
     */
    public CssOpacity() {
	CssNumber cssnum =  new CssNumber((float) 1.0);
	opaclevel = cssnum.toString();
    }
    
    /**
     * Create a new CssOpacity
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssOpacity(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val instanceof CssNumber) {
	    
	    CssNumber cssnum = new CssNumber(clampedValue(ac, ((CssNumber) val).getValue()));
	    opaclevel = cssnum.toString();
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		opaclevel = "inherit";
		expression.next();
	    } else {
		throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssOpacity(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Brings all values back between 0 and 1
     *
     * @param opac The value to be modified if necessary
     */
    private float clampedValue(ApplContext ac, float opac) {
	if (opac < 0 || opac > 1) {
	    ac.getFrame().addWarning("out-of-range", Util.displayFloat(opac));
	    return ((opac<0)?0:1);
	}
	else return(opac);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssOpacity != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssOpacity = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getOpacity();
	} else {
	    return ((Css3Style) style).cssOpacity;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssOpacity &&
		opaclevel.equals( ((CssOpacity) property).opaclevel));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "opacity";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return opaclevel;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return opaclevel.equals("inherit");
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return opaclevel;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return opaclevel == cssnum.toString();
    }
    
}


--- NEW FILE: MediaWidth.java ---
//
// $Id: MediaWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaWidth.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:01:44  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaWidth extends CssProperty {
    
    CssValue value;
    
    /**
     * Create a new MediaWidth
     */
    public MediaWidth() {
	//empty
    }
    
    /**
     * Create a new MediaWidth.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "width";
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (value != null) {
	    return value.toString();
	} else {
	    return null;
	}
    }
    
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaWidth != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaWidth();
	} else {
	    return ((Css3Style) style).mediaWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof MediaWidth && value.equals(((MediaWidth) property).value));
    }
    
    /**
     * Is the value of this property is a default value.
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return false;
    }
    
}

--- NEW FILE: CssCollapse.java ---
//
// $Id: CssCollapse.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssContent;
import org.w3c.css.properties.css1.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.CssValue;


/**
 *  <P>
 *  <EM>Value:</EM> none | &lt;content&gt; | inherit <BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  There is one kind of implicit link that CSS can exploit and present as a hyperlink 
 *  and that is the relation between an element and its children.
 */

public class CssCollapse extends CssProperty {

    CssValue collapse;

    static CssIdent none = new CssIdent("none");

    /**
     * Create a new CssCollapse
     */
    public CssCollapse() {
	collapse = none;
    }

    /**
     * Create a new CssCollapse
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssCollapse(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(none)) {
	    collapse = none;
	    expression.next();
	} else if (val.equals(inherit)) {
	    collapse = inherit;
	    expression.next();
	} else {
	    try {
		CssContent content = new CssContent(ac, expression);
		expression.next();
		return;
	    } catch (InvalidParamException ie) {
		throw new InvalidParamException("value", expression.getValue(),
						getPropertyName(), ac);
	    }
	}
    }

    public CssCollapse(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssCollapse != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssCollapse = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getCollapse();
	}
	else {
	    return ((Css3Style) style).cssCollapse;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssCollapse &&
		collapse.equals(((CssCollapse) property).collapse));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "collapse";
    }

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

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

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

    /**
     * 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 (collapse == none);
    }

}

--- NEW FILE: CssFitPosition.java ---
//
// $Id: CssFitPosition.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.util.Util;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssLength;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;


public class CssFitPosition extends CssProperty implements CssOperator {
    
    String fitpos = new String();
    ApplContext ac;
    CssIdent auto = new CssIdent("auto");
    CssIdent initial = new CssIdent("initial");
    CssIdent top = new CssIdent("top");
    CssIdent center = new CssIdent("center");
    CssIdent bottom = new CssIdent("bottom");
    
    CssIdent left = new CssIdent("left");
    CssIdent right = new CssIdent("right");
    
    /**
     * Create a new CssFitPosition
     */
    public CssFitPosition() {
	fitpos = "0% 0%";
    }
    
    /**
     * Create a new CssFitPosition
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssFitPosition(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	char op = expression.getOperator();
	
	if (op == SPACE) {
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		
		if (val instanceof CssIdent) {
		    if (val.equals(top)) {
			fitpos += " " + val.toString();
		    } else if (val.equals(center)) {
			fitpos += " " + val.toString();
		    } else if (val.equals(bottom)) {
			fitpos += " " + val.toString();
		    } else if (val.equals(initial)) {
			fitpos += " " + val.toString();
		    } else {
			throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
		    }
		    
		    expression.next();
		    op = expression.getOperator();
		    val = expression.getValue();
		    
		    if (val != null && val instanceof CssIdent) {
			if (val.equals(left)) {
			    fitpos += " " + val.toString();
			} else if (val.equals(center)) {
			    fitpos += " " + val.toString();
			} else if (val.equals(right)) {
			    fitpos += " " + val.toString();
			} else {
			    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
			}
		    }
		    
		    expression.next();
		    
		} else if (val instanceof CssLength) {
		    fitpos += " " + val.toString();
		    
		    expression.next();
		    op = expression.getOperator();
		    val = expression.getValue();
		    
		    if (val != null && val instanceof CssLength) {
			fitpos += " " + val.toString();
			expression.next();
		    } else if (val instanceof CssPercentage) {
			fitpos += " " + val.toString();
			expression.next();
		    }
		    
		} else if (val instanceof CssPercentage) {
		    fitpos += " " + val.toString();
		    
		    expression.next();
		    op = expression.getOperator();
		    val = expression.getValue();
		    
		    if (val != null && val instanceof CssLength) {
			fitpos += " " + val.toString();
			expression.next();
		    } else if (val instanceof CssPercentage) {
			fitpos += " " + val.toString();
			expression.next();
		    }
		    
		} else {
		    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
		}
	    }
	    
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		fitpos = "inherit";
		expression.next();
	    } else if (val.equals(auto)) {
		fitpos = "auto";
		expression.next();
	    } else if (val.equals(initial)) {
		fitpos = "initial";
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssFitPosition(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Brings all values back between 0 and 1
     *
     * @param opac The value to be modified if necessary
     */
    private float clampedValue(ApplContext ac, float opac) {
	if (opac < 0 || opac > 1) {
	    ac.getFrame().addWarning("out-of-range", Util.displayFloat(opac));
	    return ((opac<0)?0:1);
	}
	else return(opac);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssFitPosition != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssFitPosition = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getFitPosition();
	} else {
	    return ((Css3Style) style).cssFitPosition;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssFitPosition &&
		fitpos.equals( ((CssFitPosition) property).fitpos));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "fit-position";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return fitpos;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return fitpos.equals("inherit");
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return fitpos;
    }
    
    /**
     * 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 fitpos.equals("0% 0%");
    }
    
}


--- NEW FILE: MediaMinDeviceHeight.java ---
//
// $Id: MediaMinDeviceHeight.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMinDeviceHeight.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:02:55  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMinDeviceHeight extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMinDeviceHeight
     */
    public MediaMinDeviceHeight() {
		//empty
    }

    /**
     * Create a new MediaMinDeviceHeight.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMinDeviceHeight(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaMinDeviceHeight(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-device-height";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMinDeviceHeight != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMinDeviceHeight = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMinDeviceHeight();
	} else {
	    return ((Css3Style) style).mediaMinDeviceHeight;
	}
    }

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

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

}

--- NEW FILE: CssBorderTopLeftFitWidth.java ---
//
// $Id: CssBorderTopLeftFitWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderTopLeftFitWidth extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderTopLeftFitWidth
     */
    public CssBorderTopLeftFitWidth() {
	value = "overwrite";
    }
    
    /**
     * Create a new CssBorderTopLeftFitWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderTopLeftFitWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderTopLeftFitWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopLeftFitWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopLeftFitWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopLeftFitWidth();
	}
	else {
	    return ((Css3Style) style).cssBorderTopLeftFitWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopLeftFitWidth &&
		value.equals(((CssBorderTopLeftFitWidth) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-left-fit-width";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("overwrite");
    }
    
}

--- NEW FILE: CssTextUlColor.java ---
//
// $Id: CssTextUlColor.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM>  auto || &lt;color&gt; || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies the color for the underline.
 */

public class CssTextUlColor extends CssProperty {
 
    CssValue ulcolor;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssTextUlColor
     */
    public CssTextUlColor() {
	ulcolor = auto;
    }

    /**
     * Create a new CssTextUlColor
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextUlColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	boolean correct = false;

	if (val instanceof org.w3c.css.values.CssColor) {
	    ulcolor = val;
	    expression.next();
	}
        else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		ulcolor = inherit;
		expression.next();
	    }
	    else if (val.equals(auto)) {
		ulcolor = auto;
		expression.next();
	    }
	    else {
		ulcolor = new org.w3c.css.values.CssColor(ac, (String) val.get());
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", 
					    expression.getValue(), 
					    getPropertyName(), ac);
	}
    }

    public CssTextUlColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextUlColor != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextUlColor = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextUlColor();
	}
	else {
	    return ((Css3Style) style).cssTextUlColor;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextUlColor &&
		ulcolor.equals(((CssTextUlColor) property).ulcolor));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-underline-color";
    }

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

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

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

    /**
     * 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 ulcolor == auto;
    }

}

--- NEW FILE: CssWordBreakInside.java ---
//
// $Id: CssWordBreakInside.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> normal || hyphenate || inherit<BR>
 *  <EM>Initial:</EM>normal<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property controls the hyphenation behavior inside of words. 
 */

public class CssWordBreakInside extends CssProperty {
    
    CssValue wordbreak;

    CssIdent normal = new CssIdent("normal");
    CssIdent hyphenate = new CssIdent("hyphenate");
    
    /**
     * Create a new CssWordBreakInside
     */
    public CssWordBreakInside() {
	wordbreak = normal;
    }
    
    /**
     * Create a new CssWordBreakInside
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssWordBreakInside(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(normal)) {
	    wordbreak = normal;
	    expression.next();
	}
	else if (val.equals(hyphenate)) {
	    wordbreak = hyphenate;	
    	    expression.next();
	}
	else if (val.equals(inherit)) {
	    wordbreak = inherit;
     	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssWordBreakInside(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssWordBreakInside != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssWordBreakInside = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getWordBreakInside();
	}
	else {
	    return ((Css3Style) style).cssWordBreakInside;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssWordBreakInside &&
		wordbreak.equals(((CssWordBreakInside) property).wordbreak));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "word-break-inside";
    }

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

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

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

    /**
     * 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 wordbreak == normal;
    }

}
	    

--- NEW FILE: CssMarqueeStyle.java ---
//
// $Id: CssMarqueeStyle.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

public class CssMarqueeStyle extends CssProperty {

    CssValue mstyle;

    static CssIdent alternate = new CssIdent("alternate");

    private static String[] values = {
		"none", "slide", "scroll", "alternate", "initial", "inherit"
    };

    /**
     * Create a new CssMarqueeStyle
     */
    public CssMarqueeStyle() {
		mstyle = alternate;
    }

    /**
     * Create a new CssMarqueeStyle
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssMarqueeStyle(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	int i = 0;
	for (;i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		mstyle = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value",
					    expression.getValue(),
					    getPropertyName(), ac);
	}

    }

    public CssMarqueeStyle(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssMarqueeStyle != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssMarqueeStyle = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMarqueeStyle();
	}
	else {
	    return ((Css3Style) style).cssMarqueeStyle;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "marquee-style";
    }

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

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

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

    /**
     * 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 mstyle == alternate;
    }

}

--- NEW FILE: CssBorderTopImage.java ---
//
// $Id: CssBorderTopImage.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;



public class CssBorderTopImage extends CssProperty {
    
    String value;
    ApplContext ac;
    CssIdent none = new CssIdent("none");
    
    /**
     * Create new CssBorderTopImage
     */
    public CssBorderTopImage() {
	value = "none";
    }
    
    /**
     * Create new CssBorderTopImage
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderTopImage(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssIdent) {
	    if (val.equals(none)) {
		value = "none";
		expression.next();
	    } else if (val.equals(inherit)) {
		value = "inherit";
		expression.next();
	    }
	} else if (val instanceof CssURL) {
	    
	    value = val.toString();
	    expression.next();
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		if (val instanceof CssURL) {
		    value += " " + val.toString();
		    expression.next();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
		
		expression.next();
		val = expression.getValue();
		
		if (val != null) {
		    if (val instanceof CssURL) {
			value += " " + val.toString();
			expression.next();
		    } else {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		}
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBorderTopImage(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopImage != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopImage = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopImage();
	} else {
	    return ((Css3Style) style).cssBorderTopImage;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopImage &&
		value.equals( ((CssBorderTopImage) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-image";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }

}

--- NEW FILE: CssResizer.java ---
//
// $Id: CssResizer.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || both || horizontal || vertical || none || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:interactive
 */

public class CssResizer extends CssProperty {

    CssValue resz;
    ApplContext ac;

    CssIdent auto = new CssIdent("auto");
    CssIdent both = new CssIdent("both");
    CssIdent horizontal = new CssIdent("horizontal");
    CssIdent vertical = new CssIdent("vertical");
    CssIdent none = new CssIdent("none");
    
    /**
     * Create a new CssResizer
     */
    public CssResizer() {
	resz = auto;
    }

    /** 
     * Create a new CssResizer
     */
    public CssResizer(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(auto)) {
	    resz = auto;
	    expression.next();
	}
	else if (val.equals(both)) {
	    resz = both;
	    expression.next();
	}
	else if (val.equals(horizontal)) {
	    resz = horizontal;
	    expression.next();
	}
	else if (val.equals(vertical)) {
	    resz = vertical;
	    expression.next();
	}
	else if (val.equals(none)) {
	    resz = none;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    resz = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssResizer(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssResizer != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssResizer = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getResizer();
	} else {
	    return ((Css3Style) style).cssResizer;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssResizer && 
                resz.equals( ((CssResizer) property).resz));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "resizer";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return resz;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return resz.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return resz.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 resz == auto;
    }
    
}	

--- NEW FILE: CssBlockProgression.java ---
//
// $Id: CssBlockProgression.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssOperator;
import org.w3c.css.values.CssValue;

public class CssBlockProgression extends CssProperty implements CssOperator {
    
    CssValue blockprog;
    ApplContext ac;
    CssIdent tb = new CssIdent("tb");
    CssIdent rl = new CssIdent("rl");
    CssIdent lr = new CssIdent("lr");
    
    /**
     * Create a new CssBlockProgression
     */
    public CssBlockProgression() {
	blockprog = tb;
    }
    
    /**
     * Create a new CssBlockProgression
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBlockProgression(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val.equals(tb)) {
	    blockprog = val;
	    expression.next();
	}
	else if (val.equals(rl)) {
	    blockprog = val;
	    expression.next();
	}
	else if (val.equals(lr)) {
	    blockprog = val;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    blockprog = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssBlockProgression(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBlockProgression != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBlockProgression = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBlockProgression();
	} else {
	    return ((Css3Style) style).cssBlockProgression;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBlockProgression &&
		blockprog.equals( ((CssBlockProgression) property).blockprog));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "block-progression";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return blockprog;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return blockprog.equals("inherit");
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return blockprog.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 blockprog.equals(new CssIdent("tb"));
    }
    
}


--- NEW FILE: CssIcon.java ---
//
// $Id: CssIcon.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
// Updated september 14th 2000 by Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 */
package org.w3c.css.properties.css3;
import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssOperator;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class CssIcon extends CssProperty
    implements CssOperator {

    int value;
    CssValue icon;
    Vector uris = new Vector();
    CssIdent auto = new CssIdent("auto");
    boolean inheritedValue;

    /**
     * Create a new CssIcon
     */
    public CssIcon() {
		value = 0;
    }

    /**
     * Create a new CssIcon
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssIcon(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	CssValue val = expression.getValue();
	char op = expression.getOperator();
	
	setByUser();
	boolean correct = false;
	
	
	if (val.equals(inherit)) {
	    inheritedValue = true;
	    icon = inherit;
	    expression.next();
	    return;
	} else if (val.equals(auto)) {
	    icon = auto;
	    expression.next();
	    return;
	}
	
	while (val != null) {
	    if (val instanceof CssURL) {
		uris.addElement(val);
		expression.next();
		val = expression.getValue();
		op = expression.getOperator();
		correct = true;
	    } else {
		throw new InvalidParamException("value",
			val.toString(), getPropertyName(), ac);
	    }
	}
	
	if (!correct) {
	    throw new InvalidParamException("value",
		    val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssIcon(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
		return null;
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
		return "icon";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
		return inheritedValue;
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
		if (icon != null) {
		    return icon.toString();
		} else {
		    int i = 0;
		    int l = uris.size();
		    String ret = "";
		    while (i != l) {
			ret += uris.elementAt(i++) +
			    (new Character(COMMA)).toString() + " ";
		    }

		    return ret;
		}
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
		Css3Style style0 = (Css3Style) style;
		if (style0.cssIcon != null)
		    style0.addRedefinitionWarning(ac, this);
		style0.cssIcon = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
		if (resolve) {
		    return ((Css3Style) style).getIcon();
		} else {
		    return ((Css3Style) style).cssIcon;
		}
    }

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

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

}

--- NEW FILE: CssLineBreak.java ---
//
// $Id: CssLineBreak.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> normal || strict || inherit<BR>
 *  <EM>Initial:</EM>normal<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property selects the set of line breaking rules to be used for text. The values described below are especially useful to CJK authors, but the property itself is open to other, not yet specified settings for non-CJK
authors as well.
 */

public class CssLineBreak extends CssProperty {
    
    CssValue linebreak;

    CssIdent normal = new CssIdent("normal");
    CssIdent strict = new CssIdent("strict");

    /**
     * Create a new CssLineBreak
     */
    public CssLineBreak() {
	linebreak = normal;
    }
    
    /** 
     * Create a new CssLineBreak
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssLineBreak(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(normal)) {
	    linebreak = normal;
	    expression.next();
	}
	else if (val.equals(strict)) {
	    linebreak = strict;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    linebreak = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssLineBreak(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssLineBreak != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssLineBreak = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getLineBreak();
	}
	else {
	    return ((Css3Style) style).cssLineBreak;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssLineBreak &&
		linebreak.equals(((CssLineBreak) property).linebreak));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "line-break";
    }

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

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

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

    /**
     * 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 linebreak == normal;
    }

}



--- NEW FILE: CssDisplayRole.java ---
//
// $Id: CssDisplayRole.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none | block | inline | list-item | marker | run-in | compact |
 *  table-row | table-cell | table-row-group | table-header-group | table-footer-group |
 *  table-column | table-column-group | table-caption | ruby-text | ruby-base |
 *  ruby-base-group | ruby-text-group | inherited <BR>
 *  <EM>Initial:</EM>inline<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssDisplayRole extends CssProperty {

    CssValue role;

    static CssIdent inline = new CssIdent("inline");

    private static String[] values = {
	"none", "block", "inline", "list-item", "run-in", "compact", "table-row",
	"table-cell", "table-row-group", "table-header-group", "table-footer-group",
	"table-column", "table-column-group", "table-caption", "ruby-text", "ruby-base",
	"ruby-base-group", "ruby-text-group", "initial", "inherit"
    };

    /**
     * Create a new CssDisplayRole
     */
    public CssDisplayRole() {
	role = inline;
    }

    /**
     * Create a new CssDisplayRole
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssDisplayRole(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		role = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssDisplayRole(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssDisplayRole != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssDisplayRole = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getDisplayRole();
	}
	else {
	    return ((Css3Style) style).cssDisplayRole;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "display-role";
    }

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

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

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

    /**
     * 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 (role == inline);
    }

}

--- NEW FILE: CssCrop.java ---
//
// $Id: CssCrop.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt; alphavalue&gt; || inherit<BR>
 *  <EM>Initial:</EM>1<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property sets the Crop of an element.
 *  <PRE>
 *  H1 { Crop: 0}
 *  </PRE>
 */

public class CssCrop extends CssProperty implements CssOperator {
    
    String crop;
    ApplContext ac;
    CssIdent none = new CssIdent("none");
    CssIdent initial = new CssIdent("initial");
    
    /**
     * Create a new CssCrop
     */
    public CssCrop() {
	crop = "none";
    }
    
    /**
     * Create a new CssCrop
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssCrop(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val instanceof CssFunction) {
	    CssFunction fun = (CssFunction) val;
	    CssExpression params = fun.getParameters();
	    
	    CssValue v;
	    
	    if (fun.getName().equals("rect")) {
		if (params.getCount() == 4) {
		    
		    crop = "rect(";
		    
		    for (int i =0; i < 4; i++) {
			v = params.getValue();
			if (!(v instanceof CssLength || v instanceof CssPercentage) ) {
			    throw new InvalidParamException("value", params.getValue(),
				    getPropertyName(), ac);
			} else {
			    if (i == 0)
				crop += v.toString();
			    else
				crop += ", " + v.toString();
			}
			params.next();
		    }
		    
		} else {
		    throw new InvalidParamException("value", params.getValue(),
			    getPropertyName(), ac);
		}
	    } else if (fun.getName().equals("inset-rect")) {
		
		if (params.getCount() == 4) {
		    
		    crop = "inset-rect(";
		    
		    for (int i =0; i < 4; i++) {
			v = params.getValue();
			if (!(v instanceof CssLength || v instanceof CssPercentage) ) {
			    throw new InvalidParamException("value", params.getValue(),
				    getPropertyName(), ac);
			} else {
			    if (i == 0)
				crop += v.toString();
			    else
				crop += ", " + v.toString();
			}
			params.next();
		    }
		    
		} else {
		    throw new InvalidParamException("value", params.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	    
	    crop += ")";
	    expression.next();
	    return;
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		crop = "inherit";
		expression.next();
	    } else if (val.equals(none)) {
		crop = "none";
		expression.next();
	    } else if (val.equals(initial)) {
		crop = "initial";
		expression.next();
	    } else {
		throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssCrop(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssCrop != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssCrop = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getCrop();
	} else {
	    return ((Css3Style) style).cssCrop;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssCrop &&
		crop.equals( ((CssCrop) property).crop));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "crop";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return crop;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return crop.equals("inherit");
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return crop;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return crop == cssnum.toString();
    }
    
}


--- NEW FILE: CssLineStackingShift.java ---
//
// $Id: CssLineStackingShift.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */

public class CssLineStackingShift extends CssProperty {

    CssValue linestackingshift;

    private static CssIdent initial = new CssIdent("initial");
    private static CssIdent considershifts = new CssIdent("consider-shifts");
    private static CssIdent disregardshifts = new CssIdent("disregard-shifts");

    /**
     * Create a new CssLineStackingShift
     */
    public CssLineStackingShift() {
		linestackingshift = considershifts;
    }

    /**
     * Create a new CssLineStackingShift
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssLineStackingShift(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(initial)) {
		linestackingshift = initial;
		expression.next();
	}
	else if (val.equals(considershifts)) {
		linestackingshift = considershifts;
		expression.next();
	}
	else if (val.equals(disregardshifts)) {
		linestackingshift = disregardshifts;
		expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssLineStackingShift(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssLineStackingShift != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssLineStackingShift = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getLineStackingShift();
	}
	else {
	    return ((Css3Style) style).cssLineStackingShift;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "line-stacking-shift";
    }

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

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

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

    /**
     * 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 linestackingshift == considershifts;
    }

}

--- NEW FILE: CssWordSpacingCSS3.java ---
//
// $Id: CssWordSpacingCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssWordSpacingCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/08/09 12:29:14  sijtsche
 * extra value for word-spacing added, therefore separate CSS3 version
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:08  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:31  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:40  plehegar
 * Nothing
 *
 * Revision 1.3  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:20:24  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/23 21:35:36  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'word-spacing'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> normal | &lt;length&gt; <BR>
 *   <EM>Initial:</EM> normal<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> yes<BR>
 *   <EM>Percentage values:</EM> N/A<BR>
 *   <P> The length unit indicates an addition to the default space between
 *   words.  Values can be negative, but there may be implementation-specific
 *   limits.  The UA is free to select the exact spacing algorithm. The word
 *   spacing may also be influenced by justification (which is a value of the
 *   'align' property).
 *   <PRE>
 *   H1 { word-spacing: 0.4em }
 * </PRE>
 *   <P>
 *   Here, the word-spacing between each word in 'H1' elements would be increased
 *   by '1em'.
 *
 * @version $Revision: 1.1 $
 */
public class CssWordSpacingCSS3 extends CssProperty {

    private CssValue length;
    private static CssIdent normal = new CssIdent("normal");
	private static CssIdent none = new CssIdent("none");

    /**
     * Create a new CssWordSpacing.
     */
    public CssWordSpacingCSS3() {
	length = normal;
    }

    /**
     * Create a new CssWordSpacing with an expression
     *
     * @param expression The expression
     * @exception InvalidParamException The expression is incorrect
     */
    public CssWordSpacingCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();

	if (val instanceof CssLength) {
	    length = (CssLength) val;
	    expression.next();
	} else if (val instanceof CssNumber) {
	    length = ((CssNumber) val).getLength();
	    expression.next();
	} else if (val.equals(inherit)) {
	    length = inherit;
	    expression.next();
	} else if (val.equals(normal)) {
	    length = normal;
	    expression.next();
	} else if (val.equals(none)) {
		length = none;
		expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssWordSpacingCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return length;
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "word-spacing";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return length == inherit;
    }

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

    /**
     * Adds this property to a style.
     *
     * @param style The style.
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssWordSpacing != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssWordSpacing = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getCssWordSpacing();
	} else {
	    return ((Css3Style) style).cssWordSpacing;
	}
    }

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

}

--- NEW FILE: CssMaxHeightCSS3.java ---
//
// $Id: CssMaxHeightCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 */
public class CssMaxHeightCSS3 extends CssProperty {

    CssValue value;

    private static CssIdent none = new CssIdent("none");
    private static CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssMaxHeightCSS3
     */
    public CssMaxHeightCSS3() {
	value = none;
    }

    /**
     * Create a new CssMaxHeightCSS3.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssMaxHeightCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssLength || val instanceof CssPercentage) {
	    float f = ((Float) val.get()).floatValue();
	    if (f < 0) {
		throw new InvalidParamException("negative-value",
						val.toString(), ac);
	    }
	    value = val;
	} else if (val.equals(none)) {
	    value = none;
	} else if (val.equals(initial)) {
	    value = initial;
	} else if (val instanceof CssNumber) {
	    value = ((CssNumber) val).getLength();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}

	expression.next();
    }

    public CssMaxHeightCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "max-height";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssMaxHeightCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssMaxHeightCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMaxHeightCSS3();
	} else {
	    return ((Css3Style) style).cssMaxHeightCSS3;
	}
    }

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

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

}

--- NEW FILE: CssHeightCSS3.java ---
//
// $Id: CssHeightCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssHeightCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:13:49  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:23  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:20  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:05  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:03  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:41:58  plehegar
 * bug fix
 *
 * Revision 1.1  1997/07/25 15:38:12  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *   <H4>
 *      &nbsp;&nbsp; 'height'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> &lt;length&gt; | auto <BR>
 *   <EM>Initial:</EM> auto<BR>
 *   <EM>Applies to:</EM> block-level and replaced elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> N/A<BR>
 *   <P>
 *   This property can be applied to text, but it is most useful with replaced
 *   elements such as images. The height is to be enforced by scaling the image
 *   if necessary. When scaling, the aspect ratio of the image is preserved if
 *   the 'width' property is 'auto'.
 *   <P>
 *   Example:
 *   <PRE>
 *   IMG.icon { height: 100px }
 *   </PRE>
 *   <P>
 *   If the 'width' and 'height' of a replaced element are both 'auto', these
 *   properties will be set to the intrinsic dimensions of the element.
 *   <P>
 *   If applied to a textual element, the height can be enforced with e.g. a
 *   scrollbar.
 *   <P>
 *   Negative values are not allowed.
 * @version $Revision: 1.1 $
 */
public class CssHeightCSS3 extends CssProperty {

    CssValue value;

    private static CssIdent auto = new CssIdent("auto");
    private static CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssHeightCSS3
     */
    public CssHeightCSS3() {
	value = auto;
    }

    /**
     * Create a new CssHeightCSS3
     *
     * @param expression The expression for this property
     * @exception InvalidParamException The expression is incorrect
     */
    public CssHeightCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();
	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val.equals(initial)) {
		value = initial;
	} else if (val instanceof CssLength || val instanceof CssPercentage) {
	    float f = ((Float) val.get()).floatValue();
	    if (f < 0) {
		throw new InvalidParamException("negative-value",
						val.toString(), ac);
	    }
	    value = val;
	} else if (val.equals(auto)) {
	    value = auto;
	} else if (val instanceof CssNumber) {
	    value = ((CssNumber) val).getLength();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}

	expression.next();
    }

    public CssHeightCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "height";
    }

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

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

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssHeightCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssHeightCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getHeightCSS3();
	} else {
	    return ((Css3Style) style).cssHeightCSS3;
	}
    }

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

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

}

--- NEW FILE: CssRenderIntent.java ---
//
// $Id: CssRenderIntent.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 * <P>
 * <EM>Value:</EM> auto || perceptual || relative-colorimetric ||
 * saturation || absolute-colorimetric || inherit<BR>
 * <EM>Initial:</EM>auto<BR>
 * <EM>Applies to:</EM>all elements<BR>
 * <EM>Inherited</EM>yes<BR>
 * <EM>Percentages:</EM>no<BR>
 * <EM>Media:</EM>visual
 * <P>
 * This property permits the specification of a color profile rendering intent other than the default.
 * The behavior of values other than auto and inherent are defined by the International Color Consortium standard.
 */
public class CssRenderIntent extends CssProperty {
    
    CssValue renderintent;
    
    static CssIdent auto = new CssIdent("auto");
    static CssIdent abscolorimetric = new CssIdent("absolute-colorimetric");
    static CssIdent relcolorimetric = new CssIdent("relative-colorimetric");
    static CssIdent saturation = new CssIdent("saturation");
    static CssIdent perceptual = new CssIdent("perceptual");
    
    /**
     * Create a new CssRenderIntent
     */
    public CssRenderIntent() {
	renderintent = auto;
    }
    
    /**
     * Create a new CssRenderIntent
     *
     *
     */
    public CssRenderIntent(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(auto)) {
	    renderintent = auto;
	    expression.next();
	}
	else if (val.equals(perceptual)) {
	    renderintent = perceptual;
	    expression.next();
	}
	else if (val.equals(relcolorimetric)) {
	    renderintent = relcolorimetric;
	    expression.next();
	}
	else if (val.equals(saturation)) {
	    renderintent = saturation;
	    expression.next();
	}
	else if (val.equals(abscolorimetric)) {
	    renderintent = abscolorimetric;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    renderintent = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssRenderIntent(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssRenderIntent != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssRenderIntent = this;
	
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getRenderIntent();
	} else {
	    return ((Css3Style) style).cssRenderIntent;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssRenderIntent &&
		renderintent.equals( ((CssRenderIntent) property).renderintent));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "rendering-intent";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return renderintent;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return renderintent.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return renderintent.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 renderintent == auto;
    }
    
}

--- NEW FILE: CssTextCombine.java ---
//
// $Id: CssTextCombine.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || letters || lines || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property controls the creation of composite characters 
 *  (a.k.a. "kumimoji") or lines (a.k.a. "warichu"). 
 */

public class CssTextCombine extends CssProperty {

    CssValue combine;

    static CssIdent none = new CssIdent("none");
    static CssIdent letters = new CssIdent("letters");
    static CssIdent lines = new CssIdent("lines");

    /**
     * Create a new CssCombine
     */
    public CssTextCombine() {
	combine = none;
    }

    /**
     * Create a new CssTextCombine
     *
     * @param expression The expression for this parameter
     * @exception InvalidParamException Incorrect value
     */
    public CssTextCombine(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(none)) {
	    combine = none;
	    expression.next();
	}
	else if (val.equals(letters)) {
	    combine = letters;
	    expression.next();
	}
	else if (val.equals(lines)) {
	    combine = lines;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    combine = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextCombine(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextCombine != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextCombine = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextCombine();
	}
	else {
	    return ((Css3Style) style).cssTextCombine;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextCombine &&
		combine.equals(((CssTextCombine) property).combine));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-combine";
    }

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

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

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

    /**
     * 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 combine == none;
    }

}

--- NEW FILE: CssBorderCornerImage.java ---
//
// $Id: CssBorderCornerImage.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;



public class CssBorderCornerImage extends CssProperty {
    
    String value = "";
    ApplContext ac;
    CssIdent none = new CssIdent("none");
    CssIdent cont = new CssIdent("continue");
    
    /**
     * Create new CssBorderCornerImage
     */
    public CssBorderCornerImage() {
	value = "none";
    }
    
    /**
     * Create new CssBorderCornerImage
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderCornerImage(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = null;
	
	if (!(expression.getCount() <= 4)) {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	if (expression.getCount() == 1) {
	    if (val.equals(cont)) {
		value = "continue";
	    } else if (val.equals(none)) {
		value = "none";
	    } else if (val instanceof CssURL) {
		value = val.toString();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	} else {
	    
	    for (int i=0; i < expression.getCount(); i++) {
		
		val = expression.getValue();
		
		if (val != null) {
		    if (val.equals(cont)) {
			value += "continue ";
		    } else if (val instanceof CssURL) {
			value += val.toString() + " ";
		    } else {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		    
		} else {
		    break;
		}
		
		expression.next();
	    }
	    
	}	
	value = value.trim();		
    }
 
    public CssBorderCornerImage(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderCornerImage != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderCornerImage = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderCornerImage();
	} else {
	    return ((Css3Style) style).cssBorderCornerImage;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderCornerImage &&
		value.equals( ((CssBorderCornerImage) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-corner-image";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: CssDropInitialAfterAdjust.java ---
//
// $Id: CssDropInitialAfterAdjust.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || &lt;percentage&gt; || &lt;length&gt; || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>refers to the 'line-height' of the element<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'alignment-adjust' property allows more precise alignment of
 *  elements, such as graphics, that do not have a baseline-table
 *  or lack the desired baseline in their baseline-table. With the
 *  'alignment-adjust' property, the position of the baseline
 *  identified by the 'alignment-baseline' can be explicitly determined.
 */

public class CssDropInitialAfterAdjust extends CssProperty {

    CssValue dropvalue;

    CssIdent textafteredge = new CssIdent("text-after-edge");

    private static String[] values = {
	"middle", "central", "after-edge", "text-after-edge",
	"ideographic", "alphabetic", "hanging", "mathematical", "inherit", "initial"
    };

    /**
     * Create a new CssDropInitialAfterAdjust
     */
    public CssDropInitialAfterAdjust() {
	dropvalue = textafteredge;
    }

    /**
     * Create a new CssDropInitialAfterAdjust
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssDropInitialAfterAdjust(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val instanceof CssIdent) {
		int i = 0;
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
				dropvalue = val;
				expression.next();
				break;
	    	}
		}
		if (i == values.length) {
			    throw new InvalidParamException("value", expression.getValue(),
							    getPropertyName(), ac);
		}
	}
	else if (val instanceof CssPercentage) {
	    dropvalue = val;
	    expression.next();
	}
	else if (val instanceof CssLength) {
	    dropvalue = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }
    
    public CssDropInitialAfterAdjust(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssDropInitialAfterAdjust != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssDropInitialAfterAdjust = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getDropInitialAfterAdjust();
	}
	else {
	    return ((Css3Style) style).cssDropInitialAfterAdjust;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "drop-initial-after-adjust";
    }

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

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

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

    /**
     * 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 dropvalue == textafteredge;
    }

}

--- NEW FILE: CssTextSpace.java ---
//
// $Id: CssTextSpace.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> normal || honor || inherit<BR>
 *  <EM>Initial:</EM>normal<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property controls whether or not white space in text stream is 
 *  collapsed, or kept as is.
 */

public class CssTextSpace extends CssProperty {
 
    CssValue textspace;
    ApplContext ac;

    static CssIdent normal = new CssIdent("normal");
    static CssIdent honor = new CssIdent("honor");

    /**
     * Create a new CssTextSpace
     */
    public CssTextSpace() {
	textspace = normal;
    }

    /**
     * Create a new CssTextSpace
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextSpace(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(normal)) {
	    textspace = normal;
	    expression.next();
	}
	else if (val.equals(honor)) {
	    textspace = honor;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    textspace = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(),
		    getPropertyName(), ac);
	}
    }

    public CssTextSpace(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextSpace != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextSpace = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextSpace();
	}
	else {
	    return ((Css3Style) style).cssTextSpace;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextSpace &&
		textspace.equals(((CssTextSpace) property).textspace));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-space";
    }

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

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

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

    /**
     * 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 textspace == normal;
    }

}

--- NEW FILE: CssMarqueeSpeed.java ---
//
// $Id: CssMarqueeSpeed.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssTime;
import org.w3c.css.values.CssValue;

public class CssMarqueeSpeed extends CssProperty {

    String mspeed;

    static CssIdent slow = new CssIdent("slow");
    static CssIdent normal = new CssIdent("normal");
    static CssIdent fast = new CssIdent("fast");
    static CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssMarqueeSpeed
     */
    public CssMarqueeSpeed() {
		mspeed = "normal";
    }

    /**
     * Create a new CssMarqueeSpeed
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssMarqueeSpeed(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(normal)) {
	    mspeed = "normal";
	    expression.next();
	}
	else if (val.equals(slow)) {
	    mspeed = "slow";
	    expression.next();
	}
	else if (val.equals(initial)) {
		mspeed = "initial";
		expression.next();
	}
	else if (val.equals(fast)) {
	    mspeed = "fast";
	    expression.next();
	}
	else if (val instanceof CssLength) {
	    mspeed = val.toString();
	    expression.next();
	    
	    val = expression.getValue();
	    if (val != null) {
		if (val instanceof CssTime) {
		    mspeed = mspeed += " " + val.toString();
		    expression.next();
		} else {
		    throw new InvalidParamException("value", expression.getValue(), getPropertyName(), ac);
		}
	    }
	}
	else if (val.equals(inherit)) {
	    mspeed = "inherit";
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value",
		    expression.getValue(),
		    getPropertyName(), ac);
	}
	
    }

    public CssMarqueeSpeed(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssMarqueeSpeed != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssMarqueeSpeed = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMarqueeSpeed();
	}
	else {
	    return ((Css3Style) style).cssMarqueeSpeed;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "marquee-speed";
    }

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

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

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

    /**
     * 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 mspeed.equals("normal");
    }

}

--- NEW FILE: CssFit.java ---
//
// $Id: CssFit.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> fill | hidden | meet | slice <BR>
 *  <EM>Initial:</EM>hidden<BR>
 *  <EM>Applies to:</EM>replaced elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property gives a hint for how to scale a replaced element if neither its
 *  'width' nor its 'height' property is 'auto'. Not all replaced objects can be
 *  scaled, but images typically can.
 */

public class CssFit extends CssProperty {

    CssValue fit;

    static CssIdent hidden = new CssIdent("hidden");

    private static String[] values = {
	"fill", "hidden", "meet", "slice", "initial", "inherit"
    };

    /**
     * Create a new CssFit
     */
    public CssFit() {
	fit = hidden;
    }

    /**
     * Create a new CssFit
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssFit(ApplContext ac, CssExpression expression, boolean check)
    	throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		fit = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssFit(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssFit != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssFit = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getFit();
	}
	else {
	    return ((Css3Style) style).cssFit;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "fit";
    }

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

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

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

    /**
     * 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 (fit == hidden);
    }

}

--- NEW FILE: MediaMinHeight.java ---
//
// $Id: MediaMinHeight.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMinHeight.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:01:44  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMinHeight extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMinHeight
     */
    public MediaMinHeight() {
		//empty
    }

    /**
     * Create a new MediaMinHeight.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMinHeight(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaMinHeight(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-height";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMinHeight != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMinHeight = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMinHeight();
	} else {
	    return ((Css3Style) style).mediaMinHeight;
	}
    }

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

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

}

--- NEW FILE: CssColorProfile.java ---
//
// $Id: CssColorProfile.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssURL;
import org.w3c.css.values.CssValue;

/**
 * <P>
 * <EM>Value:</EM> auto || sRGB || &lt;uri&gt; || inherit<BR>
 * <EM>Initial:</EM>auto<BR>
 * <EM>Applies to:</EM>all elements or replaced elements??<BR>
 * <EM>Inherited</EM>yes<BR>
 * <EM>Percentages:</EM>no<BR>
 * <EM>Media:</EM>visual
 * <P>
 * This property permits the specification of a source color profile other
 *  than the default.
 */

    public class CssColorProfile extends CssProperty {
	
	CssValue colorprofile;

	static CssIdent auto = new CssIdent("auto");

	/**
	 * Create a new CssColorProfile
	 */
	public CssColorProfile() {
	    colorprofile = auto;
	}

	/**
	 * Create a new CssColorProfile
	 * 
	 * @param expression The expression for this property
	 * @exception InvalidParamException Values are incorrect
	 */
	public CssColorProfile(ApplContext ac, CssExpression expression,
		boolean check) throws InvalidParamException {
	    setByUser();
	    CssValue val = expression.getValue();
	    if (val instanceof CssIdent) {
		if (val.equals(inherit)) {
		    colorprofile = inherit;
		    expression.next();
		}
		else if (val.equals(auto)) {
		    colorprofile = auto;
		    expression.next();
		}
		else {
		    colorprofile = new org.w3c.css.values.CssColor(ac,
			    (String) val.get());
		    expression.next();
		}
	    }
	    else if (val instanceof CssURL) {
		colorprofile = val;
		expression.next();
	    }
	    else if (val instanceof org.w3c.css.values.CssColor) {
		colorprofile = val;
		expression.next();
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }  
        }
	
	public CssColorProfile(ApplContext ac, CssExpression expression)
		throws InvalidParamException {
	    this(ac, expression, false);
	}
	
	/**
	 * Add this property to the CssStyle.
	 *
	 * @param style The CssStyle
	 */
	public void addToStyle(ApplContext ac, CssStyle style) {
	    if (((Css3Style) style).cssColorProfile != null)
		style.addRedefinitionWarning(ac, this);
	    ((Css3Style) style).cssColorProfile = this;
	}

	/**
	 * Get this property in the style.
	 *
	 * @param style The style where the property is
	 * @param resolve if true, resolve the style to find this property
	 */  
        public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	    if (resolve) {
		return ((Css3Style) style).getColorProfile();
	    } else {
		return ((Css3Style) style).cssColorProfile;
	    }
	}
    
       /**
        * Compares two properties for equality.
        *
        * @param value The other property.
        */  
       public boolean equals(CssProperty property) {
	   return (property instanceof CssColorProfile && 
                colorprofile.equals( ((CssColorProfile) property).colorprofile));
       }

	/**
	 * Returns the name of this property
	 */
	public String getPropertyName() {
	    return "color-profile";
	}
   
	/**
	 * Returns the value of this property
	 */
	public Object get() {
	    return colorprofile;
	}
	
	/**
	 * Returns true if this property is "softly" inherited
	 */
	public boolean isSoftlyInherited() {
	    return colorprofile.equals(inherit);
	}
	
	/**
	 * Returns a string representation of the object
	 */
	public String toString() {
	    return colorprofile.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 colorprofile == auto;
	}

    }	

--- NEW FILE: CssTextOverLine.java ---
//
// $Id: CssTextOverLine.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;style&gt; || &lt;color&gt; || &lt;mode&gt; || inherit<BR>
 *  <EM>Initial:</EM>not defined for shorthand properties<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property is the shorthand for 'text-overline-style', 
 *  'text-overline-color' and 'text-overline-mode'.
 */

public class CssTextOverLine extends CssProperty 
implements CssOperator {
 
    CssValue overline;
    CssTextOLStyle tos;
    CssTextOLColor toc;
    CssTextOLMode tom;

    /**
     * Create a new CssTextOverLine
     */
    public CssTextOverLine() {
    }

    /**
     * Create a new CssTextOverLine
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextOverLine(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	CssValue val = expression.getValue();
	int maxvalues = 3;
	boolean correct = true;
	char op = SPACE;

	while (correct && (val != null) && (maxvalues-- > 0)) {

	    correct = false;

	    if (tos == null) {
		try {
		    tos = new CssTextOLStyle(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && toc == null) {
		try {
		    toc = new CssTextOLColor(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && tom == null) {
		try {
		    tom = new CssTextOLMode(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct) {
		throw new InvalidParamException("value", 
						expression.getValue(), 
						getPropertyName(), ac);
	    }

	    val = expression.getValue();
	    op = expression.getOperator();
	}
	
	if (tos == null) {
	    tos = new CssTextOLStyle();
	}
	if (toc == null) {
	    toc = new CssTextOLColor();
	}
	if (tom == null) {
	    tom = new CssTextOLMode();
	}
    }

    public CssTextOverLine(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextOverLine != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextOverLine = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextOverLine();
	}
	else {
	    return ((Css3Style) style).cssTextOverLine;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return false;
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-overline";
    }

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	
	String ret = "";

	if (tos.isByUser()) {
	    ret += " " + tos;
	}
	if (toc.isByUser()) {
	    ret += " " + toc;
	}
	if (tom.isByUser()) {
	    ret += " " + tom;
	}
	return ret.substring(1);

    }
}

--- NEW FILE: CssPunctuationTrim.java ---
//
// $Id: CssPunctuationTrim.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || start || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property determines whether or not a fullwidth punctuation mark 
 *  character should be trimmed if it appears at the beginning of a line, so 
 *  that its "ink" lines up with the first glyph in the line above and below.
 */

public class CssPunctuationTrim extends CssProperty {
 
    CssValue trim;

    static CssIdent none = new CssIdent("none");
    static CssIdent start = new CssIdent("start");

    /**
     * Create a new CssPunctuationTrim
     */
    public CssPunctuationTrim() {
	trim = none;
    }

    /**
     * Create a new CssPunctuationTrim
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssPunctuationTrim(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(none)) {
	    trim = none;
	    expression.next();
	}
	else if (val.equals(start)) {
	    trim = start;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    trim = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }

    public CssPunctuationTrim(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssPunctuationTrim != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssPunctuationTrim = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getPunctuationTrim();
	}
	else {
	    return ((Css3Style) style).cssPunctuationTrim;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssPunctuationTrim &&
		trim.equals(((CssPunctuationTrim) property).trim));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "punctuation-trim";
    }

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

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

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

    /**
     * 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 trim == none;
    }

}

--- NEW FILE: CssColumnCount.java ---
//
// $Id: CssColumnCount.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;integer&gt; || auto || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'column-count' property determines the number of columns into which the content 
 *  of the element will be flowed. 
 */

public class CssColumnCount extends CssProperty {

    CssValue count;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssColumnCount
     */
    public CssColumnCount() {
	// nothing to do
    }

    /**
     * Create a new CssColumnCount
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssColumnCount(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    count = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    count = val;
	    expression.next();
	} else if (val instanceof CssNumber) {
	    count = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssColumnCount(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssColumnCount != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssColumnCount = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getColumnCount();
	}
	else {
	    return ((Css3Style) style).cssColumnCount;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssColumnCount &&
		count.equals(((CssColumnCount) property).count));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "column-count";
    }

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

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

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

    /**
     * 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 (count == auto);
    }

}

--- NEW FILE: CssColumnPadding.java ---
//
// $Id: CssColumnPadding.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;length&gt; || &lt;percentage&gt; || inherit<BR>
 *  <EM>Initial:</EM>0<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>relative to 'column-width'<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssColumnPadding extends CssProperty {

    CssValue padding;

    /**
     * Create a new CssColumnPadding
     */
    public CssColumnPadding() {
	// nothing to do
    }

    /**
     * Create a new CssColumnPadding
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssColumnPadding(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    padding = val;
	    expression.next();
	} else if (val instanceof CssLength) {
	    padding = val;
	    expression.next();
	} else if (val instanceof CssPercentage) {
	    padding = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssColumnPadding(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssColumnPadding != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssColumnPadding = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getColumnPadding();
	}
	else {
	    return ((Css3Style) style).cssColumnPadding;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssColumnPadding &&
		padding.equals(((CssColumnPadding) property).padding));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "column-padding";
    }

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

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

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

    /**
     * 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 false;
    }

}

--- NEW FILE: CssLineGridMode.java ---
//
// $Id: CssLineGridMode.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */

    public class CssLineGridMode extends CssProperty {

	CssValue linegridmode;

	private static CssIdent none = new CssIdent("none");
	private static CssIdent ideograph = new CssIdent("ideograph");
	private static CssIdent all = new CssIdent("all");

	/**
	 * Create a new CssLineGridMode
	 */
	public CssLineGridMode() {
	    linegridmode = none;
	}

	/**
	 * Create a new CssLineGridMode
	 *
	 *
	 */
	public CssLineGridMode(ApplContext ac, CssExpression expression,
		boolean check) throws InvalidParamException {
	    setByUser();
	    CssValue val = expression.getValue();
	    if (val.equals(none)) {
			linegridmode = none;
			expression.next();
	    }
	    else if (val.equals(ideograph)) {
			linegridmode = ideograph;
			expression.next();
	    }
	    else if (val.equals(all)) {
			linegridmode = all;
			expression.next();
	    }
	    else if (val.equals(inherit)) {
			linegridmode = inherit;
			expression.next();
	    }

	    else {
		throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	    }
	}

	public CssLineGridMode(ApplContext ac, CssExpression expression)
		throws InvalidParamException {
	    this(ac, expression, false);
	}
	
	/**
	 * Add this property to the CssStyle.
	 *
	 * @param style The CssStyle
	 */
	public void addToStyle(ApplContext ac, CssStyle style) {
	    if (((Css3Style) style).cssLineGridMode != null)
		style.addRedefinitionWarning(ac, this);
	    ((Css3Style) style).cssLineGridMode = this;

	}

	/**
	 * Get this property in the style.
	 *
	 * @param style The style where the property is
	 * @param resolve if true, resolve the style to find this property
	 */
        public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	    if (resolve) {
		return ((Css3Style) style).getLineGridMode();
	    } else {
		return ((Css3Style) style).cssLineGridMode;
	    }
	}

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

	/**
	 * Returns the name of this property
	 */
	public String getPropertyName() {
	    return "line-grid-mode";
	}

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

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

	/**
	 * Returns a string representation of the object
	 */
	public String toString() {
	    return linegridmode.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 linegridmode == none;
	}

    }

--- NEW FILE: CssBorderBottomImage.java ---
//
// $Id: CssBorderBottomImage.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;



public class CssBorderBottomImage extends CssProperty {
    
    String value;
    ApplContext ac;
    CssIdent none = new CssIdent("none");
    
    /**
     * Create new CssBorderBottomImage
     */
    public CssBorderBottomImage() {
	value = "none";
    }
    
    /**
     * Create new CssBorderBottomImage
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderBottomImage(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssIdent) {
	    if (val.equals(none)) {
		value = "none";
		expression.next();
	    } else if (val.equals(inherit)) {
		value = "inherit";
		expression.next();
	    }
	} else if (val instanceof CssURL) {
	    
	    value = val.toString();
	    expression.next();
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		if (val instanceof CssURL) {
		    value += " " + val.toString();
		    expression.next();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
		
		expression.next();
		val = expression.getValue();
		
		if (val != null) {
		    if (val instanceof CssURL) {
			value += " " + val.toString();
			expression.next();
		    } else {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		}
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBorderBottomImage(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomImage != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomImage = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomImage();
	} else {
	    return ((Css3Style) style).cssBorderBottomImage;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomImage &&
		value.equals( ((CssBorderBottomImage) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-image";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: Css3Properties.java ---
//
// $Id: Css3Properties.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// Copyright(c) 1995-2000, World Wide Web Consortium, (MIT, INRIA, Keio University)
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css3;

import java.net.URL;

import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.Utf8Properties;

public class Css3Properties {
    
    public static Utf8Properties properties;
    
    public static String getString(CssProperty property, String prop) {
	return properties.getProperty(property.getPropertyName() + "." + prop);
    }
    
    public static boolean getInheritance(CssProperty property) {
	return getString(property, "inherited").equals("true");
    }
    
    static {
	properties = new Utf8Properties();
	try {
	    URL url = Css3Properties.class
	    .getResource("CSS3Default.properties");
	    properties.load(url.openStream());
	} catch (Exception e) {
	    System.err
	    .println("org.w3c.css.properties3.Css3Properties: couldn't load properties ");
	    System.err.println("  " + e.toString());
	}
    }
}

--- NEW FILE: CssOutlineOffset.java ---
//
// $Id: CssOutlineOffset.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYLeft 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyLeft statement at
// http://www.w3.org/Consortium/Legal/copyLeft-software-19980720

package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

public class CssOutlineOffset extends CssProperty {

    CssValue outlineOffset;
    ApplContext ac;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssOutlineOffset
     */
    public CssOutlineOffset() {
	// nothing to do
    }

    /**
     * Create a new CssOutlineOffset
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssOutlineOffset(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    outlineOffset = val;
	    expression.next();
	} else if (val instanceof CssLength) {
	    outlineOffset = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssOutlineOffset(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssOutlineOffset != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssOutlineOffset = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getOutlineOffset();
	}
	else {
	    return ((Css3Style) style).cssOutlineOffset;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "outline-offset";
    }

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

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

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

    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {

		CssNumber cssnum = new CssNumber(ac, (float) 0.0);
        return outlineOffset.toString() == cssnum.toString();
    }

}

--- NEW FILE: CssScript.java ---
//
// $Id: CssScript.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */
public class CssScript extends CssProperty {
    
    CssValue script;
    
    private static CssIdent auto = new CssIdent("auto");
    private static CssIdent none = new CssIdent("none");
    
    /**
     * Create a new CssScript
     */
    public CssScript() {
	script = auto;
    }
    
    /**
     * Create a new CssScript
     *
     *
     */
    public CssScript(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(auto)) {
	    script = auto;
	    expression.next();
	}
	else if (val.equals(none)) {
	    script = none;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    script = inherit;
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    script = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssScript(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssScript != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssScript = this;
	
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getScript();
	} else {
	    return ((Css3Style) style).cssScript;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssScript &&
		script.equals( ((CssScript) property).script));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-script";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return script;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return script.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return script.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 script == auto;
    }
    
}

--- NEW FILE: CssTextIndentCSS3.java ---
//
// $Id: CssTextIndentCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssTextIndentCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/07/11 14:08:42  sijtsche
 * text-indent added as CSS3 property (different from other versions)
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:05  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:29  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:36  plehegar
 * Nothing
 *
 * Revision 1.3  1997/08/06 17:30:22  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:20:20  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/23 23:06:12  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'text-indent'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> &lt;length&gt; | &lt;percentage&gt;<BR>
 *   <EM>Initial:</EM> 0<BR>
 *   <EM>Applies to:</EM> block-level elements<BR>
 *   <EM>Inherited:</EM> yes<BR>
 *   <EM>Percentage values:</EM> refer to parent element's width<BR>
 *   <P>
 *   The property specifies the indentation that appears before the first formatted
 *   line. The value of 'text-indent' may be negative, but there may be
 *   implementation-specific limits. An indentation is not inserted in the middle
 *   of an element that was broken by another (such as 'BR' in HTML).
 *   <P>
 *   Example:
 *   <PRE>
 *   P { text-indent: 3em }
 * </PRE>
 * @version $Revision: 1.1 $
 */
public class CssTextIndentCSS3 extends CssProperty  {

    CssValue value = new CssLength();
    CssIdent hanging = new CssIdent("hanging");

    /**
     * Create a new CssTextIndentCSS3
     */
    public CssTextIndentCSS3() {
    }

    /**
     * Create a new CssTextIndentCSS3
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssTextIndentCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();
	
	setByUser();
	
	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssLength || val instanceof CssPercentage) {
	    value = val;
	} else if (val instanceof CssNumber) {
	    value = ((CssNumber) val).getLength();
	} else if (val.equals(hanging)) {
	    value = hanging;
	} else {
	    throw new InvalidParamException("value", val.toString(),
		    getPropertyName(), ac);
	}
	
	expression.next();
    }
    
    public CssTextIndentCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-indent";
    }

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

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

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssTextIndentCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssTextIndentCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextIndent();
	} else {
	    return ((Css3Style) style).cssTextIndentCSS3;
	}
    }

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

--- NEW FILE: CssMaxWidthCSS3.java ---
//
// $Id: CssMaxWidthCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 */
public class CssMaxWidthCSS3 extends CssProperty {

    CssValue value;

    private static CssIdent none = new CssIdent("none");
    private static CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssMaxWidthCSS3
     */
    public CssMaxWidthCSS3() {
	value = none;
    }

    /**
     * Create a new CssMaxWidthCSS3.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssMaxWidthCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val instanceof CssLength || val instanceof CssPercentage) {
	    float f = ((Float) val.get()).floatValue();
	    if (f < 0) {
		throw new InvalidParamException("negative-value",
						val.toString(), ac);
	    }
	    value = val;
	} else if (val.equals(none)) {
	    value = none;
	} else if (val.equals(initial)) {
	    value = initial;
	} else if (val instanceof CssNumber) {
	    value = ((CssNumber) val).getLength();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}

	expression.next();
    }

    public CssMaxWidthCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "max-width";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssMaxWidthCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssMaxWidthCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMaxWidthCSS3();
	} else {
	    return ((Css3Style) style).cssMaxWidthCSS3;
	}
    }

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

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

}

--- NEW FILE: MediaMinDeviceWidth.java ---
//
// $Id: MediaMinDeviceWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMinDeviceWidth.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:02:55  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMinDeviceWidth extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMinDeviceWidth
     */
    public MediaMinDeviceWidth() {
		//empty
    }

    /**
     * Create a new MediaMinDeviceWidth.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMinDeviceWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaMinDeviceWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-device-width";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMinDeviceWidth != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMinDeviceWidth = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMinDeviceWidth();
	} else {
	    return ((Css3Style) style).mediaMinDeviceWidth;
	}
    }

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

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

}

--- NEW FILE: CssBorderBottomRightFitWidth.java ---
//
// $Id: CssBorderBottomRightFitWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderBottomRightFitWidth extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderBottomRightFitWidth
     */
    public CssBorderBottomRightFitWidth() {
	value = "overwrite";
    }
    
    /**
     * Create a new CssBorderBottomRightFitWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderBottomRightFitWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderBottomRightFitWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomRightFitWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomRightFitWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomRightFitWidth();
	}
	else {
	    return ((Css3Style) style).cssBorderBottomRightFitWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomRightFitWidth &&
		value.equals(((CssBorderBottomRightFitWidth) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-right-fit-width";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("overwrite");
    }
    
}

--- NEW FILE: CssBorderCornerFit.java ---
//
// $Id: CssBorderCornerFit.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderCornerFit extends CssProperty {
    
    String value = "";
    
    CssIdent overwrite = new CssIdent("overwrite");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderCornerFit
     */
    public CssBorderCornerFit() {
	value = "overwrite";
    }
    
    /**
     * Create a new CssBorderCornerFit
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderCornerFit(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (expression.getCount() == 4 || expression.getCount() == 2 ||
		expression.getCount() == 1) {
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		
		for (int i = 0; i < expression.getCount(); i++) {
		    
		    int j = 0;
		    for (; j < values.length; j++) {
			if (val.toString().equals(values[j])) {
			    value += val.toString() + " ";
			    expression.next();
			    break;
			}
		    }
		    
		    if (j == values.length) {
			throw new InvalidParamException("value",
				expression.getValue(), getPropertyName(), ac);
		    }
		}
	    }
	    
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
    }
    
    public CssBorderCornerFit(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderCornerFit != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderCornerFit = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderCornerFit();
	}
	else {
	    return ((Css3Style) style).cssBorderCornerFit;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderCornerFit &&
		value.equals(((CssBorderCornerFit) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-corner-fit";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("overwrite");
    }
    
}

--- NEW FILE: CssColumnRule.java ---
//
// $Id: CssColumnRule.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssBorderBottomStyle;
import org.w3c.css.properties.css1.CssBorderBottomWidth;
import org.w3c.css.properties.css1.CssBorderLeftStyle;
import org.w3c.css.properties.css1.CssBorderLeftWidth;
import org.w3c.css.properties.css1.CssBorderRightStyle;
import org.w3c.css.properties.css1.CssBorderRightWidth;
import org.w3c.css.properties.css1.CssBorderTopStyle;
import org.w3c.css.properties.css1.CssBorderTopWidth;
import org.w3c.css.properties.css1.CssColor;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;border-style&gt; || &lt;color&gt; || &lt;border-width&gt; ||
 *  inherit<BR>
 *  <EM>Initial:</EM>the value of the color property<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssColumnRule extends CssProperty
implements CssOperator {

    CssValue value;
    /* I should use border-width and border-style here, but I don't 
     * see how to implement a 
     * shorthand property for shorthand properties ... So I splitted it up
     */
    CssBorderTopWidth btw;
    CssBorderRightWidth brw;
    CssBorderLeftWidth blw;
    CssBorderBottomWidth bbw;
    CssBorderTopStyle bts;
    CssBorderRightStyle brs;
    CssBorderLeftStyle bls;
    CssBorderBottomStyle bbs;
    CssColor color;


    /**
     * Create a new CssColumnRule
     */
    public CssColumnRule() {
    }

    /**
     * Create a new CssColumnRule
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssColumnRule(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	CssValue val = expression.getValue();
	int maxvalues = 9;
	boolean correct = true;
	char op = SPACE;

	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	} else {

	    while (correct && (val != null) && (maxvalues -- > 0)) {

		correct = false;

		if (btw == null) {
		    try {
			btw = new CssBorderTopWidth(ac, expression);
			correct = true;
		    }
		    catch (InvalidParamException e) {
		    }
		}
		if (!correct && bbw == null) {
		    try {
			bbw = new CssBorderBottomWidth(ac, expression);
			correct = true;
		    }
		    catch (InvalidParamException e) {
		    }
		}
		if (!correct && blw == null) {
		    try {
			blw = new CssBorderLeftWidth(ac, expression);
			correct = true;
		    }
		    catch (InvalidParamException e) {
		    }
		}
		if (!correct && brw == null) {
		    try {
			brw = new CssBorderRightWidth(ac, expression);
			correct = true;
		    }
		    catch (InvalidParamException e) {
		    }
		}
		if (!correct && color == null) {
		    try {
			color = new CssColor(ac, expression);
			correct = true;
		    }
		    catch (InvalidParamException e) {
		    }
		}

		if (!correct && bts == null) {
		    try {
			bts = new CssBorderTopStyle(ac, expression);
			correct = true;
		    }
		    catch (InvalidParamException e) {
		    }
		}
		if (!correct && bbw == null) {
		    try {
			bbs = new CssBorderBottomStyle(ac, expression);
			correct = true;
		    }
		    catch (InvalidParamException e) {
		    }
		}
		if (!correct && bls == null) {
		    try {
			bls = new CssBorderLeftStyle(ac, expression);
			correct = true;
		    }
		    catch (InvalidParamException e) {
		    }
		}
		if (!correct && brs == null) {
		    try {
			brs = new CssBorderRightStyle(ac, expression);
			correct = true;
		    }
		    catch (InvalidParamException e) {
		    }
		}

		if (!correct) {
		    throw new InvalidParamException("value",
						    expression.getValue(),
						    getPropertyName(), ac);
		}

		val = expression.getValue();
		op = expression.getOperator();

	    }
	}
    }

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

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssColumnRule != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssColumnRule = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getColumnRule();
	}
	else {
	    return ((Css3Style) style).cssColumnRule;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "column-border";
    }

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {

	String ret = "";

	if (btw != null) {
		ret += " " + btw.toString();
	}
	if (brw != null) {
		ret += " " + brw.toString();
	}
	if (blw != null) {
		ret += " " + blw.toString();
    }
	if (bbw != null) {
		ret += " " + bbw.toString();
    }
	if (bts != null) {
		ret += " " + bts.toString();
    }
	if (brs != null) {
		ret += " " + brs.toString();
    }
	if (bls != null) {
		ret += " " + bls.toString();
    }
    if (bbs != null) {
		ret += " " + bbs.toString();
    }
    if (color != null) {
		ret += " " + color.toString();
    }

	return ret.substring(1);

    }
}

--- NEW FILE: CssWordBreak.java ---
//
// $Id: CssWordBreak.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> normal || &lt;word-break-CJK&gt; || &lt;word-break-wrap&gt; ||
 *  word-break-inside || inherit<BR>
 *  <EM>Initial:</EM>normal<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'word-break' property is a shorthand property for setting
 *  'word-break-CJK', 'word-break-wrap' and 'word-break-inside', at the same
 *  place in the style sheet.
 */

public class CssWordBreak extends CssProperty
implements CssOperator {

    CssWordBreakCJK wbc;
    CssWordBreakInside wbi;
    CssValue wordbreak;

    /**
     * Create a new CssWordBreak
     */
    public CssWordBreak() {
    }

    /**
     * Create a new CssWordBreak
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssWordBreak(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	CssValue val = expression.getValue();
	int maxvalues = 3;
	boolean correct = true;
	char op = SPACE;

	while (correct && (val != null) && (maxvalues-- > 0)) {

	    correct = false;

	    if (wbc == null) {
		try {
		    wbc = new CssWordBreakCJK(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && wbi == null) {
		try {
		    wbi = new CssWordBreakInside(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct) {
		throw new InvalidParamException("value", expression.getValue(),
						getPropertyName(), ac);
	    }

	    val = expression.getValue();
	    op = expression.getOperator();

	}

	if (wbc == null) {
	    wbc = new CssWordBreakCJK();
	}
	if (wbi == null) {
	    wbi = new CssWordBreakInside();
	}

    }

    public CssWordBreak(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssWordBreak != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssWordBreak = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getWordBreak();
	}
	else {
	    return ((Css3Style) style).cssWordBreak;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "word-break";
    }

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {

	String ret = "";
	if (wbc.isByUser()) {
	    ret += " " + wbc;
	}
	if (wbi.isByUser()) {
	    ret += " " + wbi;
	}
	return ret.substring(1);

    }

    //    /**
    // * 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 wordbreak == normal;
    //}

}

--- NEW FILE: CssTextJustify.java ---
//
// $Id: CssTextJustify.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || inter-word || inter-ideograph || distribute || 
 *  newspaper || inter-cluster || kashida || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property selects the type of justify alignment. It affects the text 
 *  layout only if 'text-align' is set to 'justify'. That way, UA's that do 
 *  not support this property will still render the text as fully
 *  justified, which most of the time is at least partially correct. Typically
 *  the text-justify property does not affect the last line, unless the last 
 *  line itself is justified. Most of the text-justify values affects
 *  writing systems in very specific ways.
 */

public class CssTextJustify extends CssProperty {

    CssValue textjustify;
    private CssIdent auto = new CssIdent("auto");

    private static String[] values = {
	"auto", "inter-word", "inter-ideograph", "distribute", 
	"newspaper", "inter-cluster", "kashida", "inherit" 
    };

    /**
     * Create a new CssTextJustify
     */
    public CssTextJustify() {
	textjustify = auto;
    }

    /**
     * Create a new CssTextJustify
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssTextJustify(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	setByUser();
	CssValue val = expression.getValue();
	
	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		textjustify = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextJustify(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextJustify != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextJustify = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextJustify();
	}
	else {
	    return ((Css3Style) style).cssTextJustify;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextJustify &&
		textjustify.equals(((CssTextJustify) property).textjustify));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-justify";
    }

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

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

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

    /**
     * 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 (textjustify == auto);
    }

}

--- NEW FILE: MediaMinMonochrome.java ---
//
// $Id: MediaMinMonochrome.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMinMonochrome.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:02:55  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMinMonochrome extends CssProperty implements CssOperator {

    CssValue value;

    /**
     * Create a new MediaMinMonochrome
     */
    public MediaMinMonochrome() {
		//empty
    }

    /**
     * Create a new MediaMinMonochrome.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMinMonochrome(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	//char op = SPACE;
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaMinMonochrome(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-monochrome";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMinMonochrome != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMinMonochrome = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMinMonochrome();
	} else {
	    return ((Css3Style) style).mediaMinMonochrome;
	}
    }

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

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

}

--- NEW FILE: CssTextUlMode.java ---
//
// $Id: CssTextUlMode.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM>  continuous || skip-white-space || inherit<BR>
 *  <EM>Initial:</EM>continuous<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies the mode for the underline, that is whether the
 *  underline is continuous or whether it appears only under words and not
 *  whitespace.
 */

public class CssTextUlMode extends CssProperty {

    CssValue ulmode;

    static CssIdent continuous = new CssIdent("continuous");
    static CssIdent skipwhitespace = new CssIdent("skip-white-space");

    /**
     * Create a new CssTextUlMode
     */
    public CssTextUlMode() {
	ulmode = continuous;
    }

    /**
     * Create a new CssTextUlStyle
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextUlMode(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(continuous)) {
	    ulmode = continuous;
	    expression.next();
	}
	else if (val.equals(skipwhitespace)) {
	    ulmode = skipwhitespace;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    ulmode = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value",
					    expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextUlMode(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextUlMode != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextUlMode = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextUlMode();
	}
	else {
	    return ((Css3Style) style).cssTextUlMode;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-underline-mode";
    }

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

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

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

    /**
     * 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 ulmode == continuous;
    }

}

--- NEW FILE: CssGlyphOrVert.java ---
//
// $Id: CssGlyphOrVert.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssAngle;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;angle&gt; || auto || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  glyph-orientation-vertical' controls glyph orientation when the primary
 *  text advance direction is vertical.
 */

public class CssGlyphOrVert extends CssProperty {

    CssValue vert;
    CssIdent auto = new CssIdent("auto");
    CssIdent inline = new CssIdent("inline");
    CssIdent upright = new CssIdent("upright");

    /**
     * Create a new CssGlyphOrVert
     */
    public CssGlyphOrVert() {
	vert = auto;
    }

    /**
     * Create a new CssGlyphOrVert
     *
     * @param expression The expression for this property
     8 @exception InvalidParamException Incorrect value
     */
    public CssGlyphOrVert(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    vert = inherit;
	    expression.next();
	} else if (val instanceof CssAngle) {
		vert = val;
		expression.next();
	} else if (val instanceof CssIdent) {
		if (val.equals(auto)) {
			vert = val;
			expression.next();
		} else if (val.equals(inline)) {
			vert = val;
			expression.next();
		} else if (val.equals(upright)) {
			vert = val;
			expression.next();
		} else {
		    throw new InvalidParamException("value", val.toString(),
					    getPropertyName(), ac);
		}
	}
	else {
	    throw new InvalidParamException("value", val.toString(),
					    getPropertyName(), ac);
	}
    }

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

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssGlyphOrVert != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssGlyphOrVert = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getGlyphOrVert();
	}
	else {
	    return ((Css3Style) style).cssGlyphOrVert;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "glyph-orientation-vertical";
    }

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

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

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

    /**
     * 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 vert == auto;
    }

}

--- NEW FILE: CssPaddingSideCSS3.java ---
//
// $Id: CssPaddingSideCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssPaddingSideCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/12/24 13:20:53  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 2.3  1997/09/08 09:15:48  plehegar
 * Bug. Padding values cannot be negative
 *
 * Revision 2.2  1997/08/20 11:41:27  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:32  plehegar
 * Nothing
 *
 * Revision 1.3  1997/08/06 17:30:16  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:20:16  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/24 01:28:20  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public abstract class CssPaddingSideCSS3 extends CssProperty {

    CssValue value;
    CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssPaddingSideCSS3.
     */
    public CssPaddingSideCSS3() {
	value = new CssLength();
    }

    /**
     * Create a new CssPaddingSideCSS3 with an another CssPaddingSideCSS3
     *
     * @param another An another side.
     */
    public CssPaddingSideCSS3(CssPaddingSideCSS3 another) {
	value = another.value;
    }

    /**
     * Create a new CssPaddingSideCSS3
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssPaddingSideCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	} else if (val.equals(initial)) {
	    value = initial;
	    expression.next();
	} else if (val instanceof CssLength || val instanceof CssPercentage) {
	    value = val;
	    float v = ((Float) val.get()).floatValue();
	    if (v < 0)
		throw new InvalidParamException("negative-value",
						Float.toString(v), ac);
	    expression.next();
	} else if (val instanceof CssNumber) {
	    value = ((CssNumber) val).getLength();
	    expression.next();
	} else {
	    throw new InvalidParamException("value", val.toString(),
					    getPropertyName(), ac);
	}
    }

    public CssPaddingSideCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the internal value
     */
    public CssValue getValue() {
	return value;
    }

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

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


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

--- NEW FILE: CssUserFocusKey.java ---
//
// $Id: CssUserFocusKey.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || normal || select-all || select-before ||
 *  select-after || select-same || select-menu || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:interactive
 *  <P>
 *  The purpose of this property is to determine what happens to an element 
 *  when the user focusses it specifically by clicking on it with a pointing 
 *  device.
 */

public class CssUserFocusKey extends CssProperty {

    CssValue userfocuskey;

    static CssIdent auto = new CssIdent("auto");
    static CssIdent normal = new CssIdent("normal");
    static CssIdent selectall = new CssIdent("select-all");
    static CssIdent selectbefore = new CssIdent("select-before");
    static CssIdent selectafter = new CssIdent("select-after");
    static CssIdent selectsame = new CssIdent("select-same");
    static CssIdent selectmenu = new CssIdent("select-menu");

    /**
     * Create a new CssUserFocusKey
     */
    public CssUserFocusKey() {
	userfocuskey = auto;
    }

    /**
     * Create a new CssUserFocusKey
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssUserFocusKey(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(auto)) {
	    userfocuskey = auto;
	    expression.next();
	}
	else if (val.equals(normal)) {
	    userfocuskey = normal;
	    expression.next();
	}
	else if (val.equals(selectall)) {
	    userfocuskey = selectall;
	    expression.next();
	}
	else if (val.equals(selectbefore)) {
	    userfocuskey = selectbefore;
	    expression.next();
	}
	else if (val.equals(selectafter)) {
	    userfocuskey = selectafter;
	    expression.next();
	}
	else if (val.equals(selectsame)) {
	    userfocuskey = selectsame;
	    expression.next();
	}
	else if (val.equals(selectmenu)) {
	    userfocuskey = selectmenu;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    userfocuskey = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssUserFocusKey(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssUserFocusKey != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssUserFocusKey = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getUserFocusKey();
	}
	else {
	    return ((Css3Style) style).cssUserFocusKey;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssUserFocusKey &&
		userfocuskey.equals(((CssUserFocusKey) property).userfocuskey));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "user-focus-key";
    }

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

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

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

    /**
     * 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 userfocuskey == auto;
    }

}



--- NEW FILE: MediaDeviceHeight.java ---
//
// $Id: MediaDeviceHeight.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaDeviceHeight.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:05:40  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaDeviceHeight extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaDeviceHeight
     */
    public MediaDeviceHeight() {
		//empty
    }

    /**
     * Create a new MediaDeviceHeight.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaDeviceHeight(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaDeviceHeight(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "device-height";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaDeviceHeight != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaDeviceHeight = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaDeviceHeight();
	} else {
	    return ((Css3Style) style).mediaDeviceHeight;
	}
    }

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

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

}

--- NEW FILE: CssLineGridProgression.java ---
//
// $Id: CssLineGridProgression.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssValue;

/**
 *
 */

    public class CssLineGridProgression extends CssProperty {

	CssValue linegridprog;

	private static CssIdent normal = new CssIdent("normal");
	private static CssIdent gridheight = new CssIdent("grid-height");

	/**
	 * Create a new CssLineGridProgression
	 */
	public CssLineGridProgression() {
	    linegridprog = normal;
	}

	/**
	 * Create a new CssLineGridProgression
	 *
	 *
	 */
	public CssLineGridProgression(ApplContext ac, CssExpression expression,
		boolean check) throws InvalidParamException {
	    setByUser();
	    CssValue val = expression.getValue();
	    if (val.equals(normal)) {
			linegridprog = normal;
			expression.next();
	    }
	    else if (val.equals(gridheight)) {
			linegridprog = gridheight;
			expression.next();
	    }
	    else if (val instanceof CssLength) {
			linegridprog = val;
			expression.next();
	    }
	    else if (val.equals(inherit)) {
			linegridprog = inherit;
			expression.next();
	    }

	    else {
		throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	    }
	}

	public CssLineGridProgression(ApplContext ac, CssExpression expression)
		throws InvalidParamException {
	    this(ac, expression, false);
	}
	
	/**
	 * Add this property to the CssStyle.
	 *
	 * @param style The CssStyle
	 */
	public void addToStyle(ApplContext ac, CssStyle style) {
	    if (((Css3Style) style).cssLineGridProgression != null)
		style.addRedefinitionWarning(ac, this);
	    ((Css3Style) style).cssLineGridProgression = this;

	}

	/**
	 * Get this property in the style.
	 *
	 * @param style The style where the property is
	 * @param resolve if true, resolve the style to find this property
	 */
        public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	    if (resolve) {
		return ((Css3Style) style).getLineGridProgression();
	    } else {
		return ((Css3Style) style).cssLineGridProgression;
	    }
	}

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

	/**
	 * Returns the name of this property
	 */
	public String getPropertyName() {
	    return "line-grid-progression";
	}

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

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

	/**
	 * Returns a string representation of the object
	 */
	public String toString() {
	    return linegridprog.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 linegridprog == normal;
	}

    }

--- NEW FILE: CssWidthCSS3.java ---
//
// $Id: CssWidthCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssWidthCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *   <H4>
 *      &nbsp;&nbsp; 'width'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> &lt;length&gt; | &lt;percentage&gt; | auto <BR>
 *   <EM>Initial:</EM> auto<BR>
 *   <EM>Applies to:</EM> block-level and replaced elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> refer to parent element's width<BR>
 *   <P>
 *   This property can be applied to text elements, but it is most useful with
 *   replaced elements such as images. The width is to be enforced by scaling
 *   the image if necessary. When scaling, the aspect ratio of the image is preserved
 *   if the 'height' property is 'auto'.
 *   <P>
 *   Example:
 *   <PRE>
 *   IMG.icon { width: 100px }
 * </PRE>
 *   <P>
 *   If the 'width' and 'height' of a replaced element are both 'auto', these
 *   properties will be set to the intrinsic dimensions of the element.
 *   <P>
 *   Negative values are not allowed.
 * @version $Revision: 1.1 $
 */
public class CssWidthCSS3 extends CssProperty {

    CssValue value;

    private static CssIdent auto = new CssIdent("auto");
    private static CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssWidthCSS3
     */
    public CssWidthCSS3() {
	value = auto;
    }

    /**
     * Create a new CssWidthCSS3.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssWidthCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val.equals(initial)) {
		value = initial;
	} else if (val instanceof CssLength || val instanceof CssPercentage) {
	    float f = ((Float) val.get()).floatValue();
	    if (f < 0) {
		throw new InvalidParamException("negative-value",
						val.toString(), ac);
	    }
	    value = val;
	} else if (val.equals(auto)) {
	    value = auto;
	} else if (val instanceof CssNumber) {
	    value = ((CssNumber) val).getLength();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}

	expression.next();
    }

    public CssWidthCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "width";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssWidthCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssWidthCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getWidthCSS3();
	} else {
	    return ((Css3Style) style).cssWidthCSS3;
	}
    }

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

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

}

--- NEW FILE: CssKerningPairTreshold.java ---
//
// $Id: CssKerningPairTreshold.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || &lt;length&gt; || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property controls the font size threshold, above which pair kerning 
 *  would be active (if enabled). 
 */

public class CssKerningPairTreshold extends CssProperty {
 
    CssValue treshold;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssKerningPairTreshold
     */
    public CssKerningPairTreshold() {
	treshold = auto;
    }

    /**
     * Create a new CssKerningPairTreshold
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssKerningPairTreshold(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(auto)) {
	    treshold = auto;
	    expression.next();
	}
	else if (val instanceof CssLength) {
	    treshold = val;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    treshold = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }

    public CssKerningPairTreshold(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssKerningPairTreshold != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssKerningPairTreshold = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getKerningPairTreshold();
	}
	else {
	    return ((Css3Style) style).cssKerningPairTreshold;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssKerningPairTreshold &&
		treshold.equals(((CssKerningPairTreshold) property).treshold));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "kerning-pair-treshold";
    }

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

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

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

    /**
     * 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 treshold == auto;
    }

}
			      

--- NEW FILE: CssColumnSpan.java ---
//
// $Id: CssColumnSpan.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;integer&gt; || none || all || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssColumnSpan extends CssProperty {
    
    CssValue value;
    ApplContext ac;
    
    CssIdent none = new CssIdent("none");
    CssIdent all = new CssIdent("all");
    
    /**
     * Create a new CssColumnSpan
     */
    public CssColumnSpan() {
	//nothing to do
    }
    
    /**
     * Create a new CssColumnSpan
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public CssColumnSpan(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val instanceof CssNumber) {
	    if (((CssNumber) val).isInteger()) {
		value = val;
		expression.next();
		return;
	    } else {
		throw new InvalidParamException("integer", 
			val.toString(), 
			getPropertyName(), ac);
	    }
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		value = inherit;
		expression.next();
	    } else if (val.equals(none)) {
		value = none;
		expression.next();
	    } else if (val.equals(all)) {
		value = all;
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), 
		    getPropertyName(), ac);
	}
    }
    
    public CssColumnSpan(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssColumnSpan != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssColumnSpan = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getColumnSpan();
	} else {
	    return ((Css3Style) style).cssColumnSpan;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssColumnSpan && 
		value.equals( ((CssColumnSpan) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "column-span";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 value == none;
    }
    
}

--- NEW FILE: CssWritingMode.java ---
//
// $Id: CssWritingMode.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> lr-tb || rl-tb || tb-rl || bt-rl || lr || rl || tb || inherit<BR>
 *  <EM>Initial:</EM>lr-tb<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property sets the primary text advance direction
 */

public class CssWritingMode extends CssProperty {

    CssValue mode;

    static CssIdent lrtb = new CssIdent("lr-tb");
    static CssIdent rltb = new CssIdent("rl-tb");
    static CssIdent tbrl = new CssIdent("tb-rl");
    static CssIdent tblr = new CssIdent("tb-lr");
    static CssIdent lr = new CssIdent("lr");
    static CssIdent rl = new CssIdent("rl");
    static CssIdent tb = new CssIdent("tb");
    static CssIdent ltr = new CssIdent("ltr");
    static CssIdent rtl = new CssIdent("rtl");


    /**
     * Create a new CssWritingMode
     */
    public CssWritingMode() {
	mode = lrtb;
    }

    /**
     * Create a new CssWritingMode
     */
    public CssWritingMode(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(lrtb)) {
	    mode = lrtb;
	    expression.next();
	}
	else if (val.equals(rltb)) {
	    mode = rltb;
	    expression.next();
	}
	else if (val.equals(tbrl)) {
	    mode = tbrl;
	    expression.next();
	}
	else if (val.equals(tblr)) {
	    mode = tblr;
	    expression.next();
	}
	else if (val.equals(lr)) {
	    mode = lr;
	    expression.next();
	}
	else if (val.equals(rl)) {
	    mode = rl;
	    expression.next();
	}
	else if (val.equals(tb)) {
	    mode = tb;
	    expression.next();
	}
	else if (val.equals(ltr)) {
	    mode = ltr;
	    expression.next();
	}
	else if (val.equals(rtl)) {
	    mode = rtl;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    mode = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssWritingMode(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssWritingMode != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssWritingMode = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getWritingMode();
	}
	else {
	    return ((Css3Style) style).cssWritingMode;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "writing-mode";
    }

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

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

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

    /**
     * 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 mode == lrtb;
    }

}

--- NEW FILE: CssMinFontSize.java ---
//
// $Id: CssMinFontSize.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.properties.css2.font.FontSize;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;font-size&gt; || inherit<BR>
 *  <EM>Initial:</EM>0<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>element's computed 'font-size'<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  If 'text-align-last' is 'size', the fonts of the last line of an element 
 *  are not allowed to become smaller than the smaller of 'font-size' and 
 *  'min-font-size'. 
 */

public class CssMinFontSize extends CssProperty {

    CssValue min;
    ApplContext ac;

    /** 
     * Create a new CssMinFontSize
     */
    public CssMinFontSize() {
	CssNumber cssnum = new CssNumber(0);
	min = cssnum;
    }

    /**
     * Create a new CssMinFontSize
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssMinFontSize(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    min = inherit;
	    expression.next();
	}
	else {
	    try {
		FontSize fontsize = new FontSize(ac, expression); 
		min = val;
		expression.next();
	    }
	    catch (InvalidParamException e) {
		throw new InvalidParamException("value", expression.getValue(),
						getPropertyName(), ac);
	    }
	}
    }

    public CssMinFontSize(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssMinFontSize != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssMinFontSize = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMinFontSize();
	} else {
	    return ((Css3Style) style).cssMinFontSize;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssMinFontSize && 
                min.equals( ((CssMinFontSize) property).min));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "min-font-size";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return min;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return min.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return min.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() {	
	CssNumber cssnum = new CssNumber(ac, 0);
	return min == cssnum;
    }
    
}
    

--- NEW FILE: CssBorderTopLeftImage.java ---
//
// $Id: CssBorderTopLeftImage.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;



public class CssBorderTopLeftImage extends CssProperty {
    
    String value = "";
    ApplContext ac;
    CssIdent contin = new CssIdent("continue");
    CssIdent none = new CssIdent("none");
    
    /**
     * Create new CssBorderTopLeftImage
     */
    public CssBorderTopLeftImage() {
	value = "continue";
    }
    
    /**
     * Create new CssBorderTopLeftImage
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderTopLeftImage(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val != null) {
	    if (val.equals(none)) {
		value = "none";
	    } else if (val.equals(contin)) {
		value = "continue";
	    } else if (val instanceof CssURL) {
		value = val.toString();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	expression.next();
    }
    
    public CssBorderTopLeftImage(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopLeftImage != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopLeftImage = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopLeftImage();
	} else {
	    return ((Css3Style) style).cssBorderTopLeftImage;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopLeftImage &&
		value.equals( ((CssBorderTopLeftImage) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-left-image";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: CssKeyEq.java ---
//
// $Id: CssKeyEq.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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 java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || &lt;key-press-combination&gt;+ || &lt;system-key-equivalent&gt; || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all enabled elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:interactive
 */

public class CssKeyEq extends CssProperty {

    CssValue keyCombi;
    Vector values = new Vector();

    CssIdent none = new CssIdent("none");
    CssIdent listitemmarker = new CssIdent("list-item-marker");

    private static String keys[] =
        { " ", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L",
	  "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
	  "accesskey", "fn", "fcn", "caps", "cmd", "rcmd", "lcmd", "opt",
	  "ropt", "lopt", "ctrl", "rctrl", "lctrl", "shift", "rshift",
	  "lshift", "alt", "ralt", "lalt", "win", "rwin", "lwin", "meta",
	  "rmeta", "lmeta", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8",
	  "f9", "f10", "f11", "f12", "f13", "f14", "f15", "tab", "esc",
	  "enter", "return", "menu", "help", "namemenu", "rcl", "snd",
	  "up", "down", "left", "right", "home", "end", "pgup", "pgdn",
	  "bs", "del", "ins", "undo", "cut", "copy", "paste", "clr", "sto",
	  "prtsc", "sysrq", "scrlock", "pause", "brk", "numlock", "pwr"};

    private static String systemkeys[] =
        { "system-new", "system-open", "system-close", "system-save",
	  "system-print", "system-quit", "system-terminate-operation",
	  "system-undo", "system-redo", "system-cut", "system-copy",
	  "system-paste", "system-clear", "system-duplicate",
	  "system-select-all", "system-find", "system-find-again",
	  "system-ok", "system-cancel", "system-apply"
	};

    /**
     * Create a new CssKeyEq
     */
    public CssKeyEq() {
	keyCombi = none;
    }

    /**
     * Create a new CssKeyEq
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssKeyEq(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	String kc = new String();
	int hyphenindex;
	int counter = 0;
	char op = expression.getOperator();
        CssValue val = expression.getValue();
	String part = new String();
	String rest = new String();
	Vector ks = new Vector();
	setByUser();

	if (val.equals(none)) {
	    keyCombi = none;
	    expression.next();
	    return;
	}
	else if (val.equals(inherit)) {
	    keyCombi = inherit;
	    expression.next();
	    return;
	} else if (val.equals(listitemmarker)) {
		keyCombi = listitemmarker;
		expression.next();
		return;
	}
	else if (val instanceof CssFunction) {
	    CssFunction attr = (CssFunction) val;
	    CssExpression params = attr.getParameters();
	    CssValue v = params.getValue();
	    if (attr.getName().equals("attr")) {
		if ((params.getCount() != 1)
		    || !(v instanceof CssIdent)) {
		    throw new InvalidParamException("attr", params.getValue(),
						    getPropertyName(), ac);
		}
	    }
	    else throw new InvalidParamException("value", expression.getValue(),
						 getPropertyName(), ac);
	    keyCombi = val;
	    expression.next();
	    return;
	}

	// check if it is a system-key-equivalent
	for (int i = 0;i < systemkeys.length; i++) {
	    if (val.toString().equals(systemkeys[i])) {
		keyCombi = val;
		expression.next();
		return;
	    }
	}
	// no error, because it still can be a normal key combination

       	while ((op == CssOperator.SPACE)
	     && (counter < expression.getCount())) {
	    kc = val.toString();
	    if (kc.indexOf("-") < 0) { // only one key
		int i = 0;
		for (;i < keys.length; i++) {
		    if (kc.equals(keys[i])) {
			break;
		    }
		}
		if (i == keys.length) {
		    throw new InvalidParamException("value",
						    expression.getValue(),
						    getPropertyName(), ac);
		}
	    }
	    else { // keycombination

		int hyphenidx = kc.indexOf("-");
		part = kc.substring(0, hyphenidx).trim();
		rest = kc.substring(hyphenidx + 1, kc.length());
		ks.addElement(part);

		while (rest.indexOf("-") >= 0) {
		    hyphenidx = rest.indexOf("-");
		    part = rest.substring(0, hyphenidx).trim();
		    rest = rest.substring(hyphenidx + 1, rest.length());
		    ks.addElement(part);
		}
		ks.addElement(rest);

		for (int idx = 0; idx < ks.size(); idx++) {
		    int i = 0;
		    for (;i < keys.length; i++) {
			if ((keys[i]).equals((String)ks.elementAt(idx))) {
			    break;
			}
		    }
		    if (i == keys.length) {
			throw new InvalidParamException("value",
							expression.getValue(),
							getPropertyName(), ac);
		    }
		}
	    }
	    values.addElement(val);
	    expression.next();
	    counter++;
	    val = expression.getValue();
	    op = expression.getOperator();
	    ks.removeAllElements();
	}

    }

    public CssKeyEq(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssKeyEq != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssKeyEq = this;

    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getKeyEq();
	} else {
	    return ((Css3Style) style).cssKeyEq;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "key-equivalent";
    }

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

    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	// @@TODO
	return false;
	//values.equals(inherit);
    }

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (keyCombi != null)
	    return keyCombi.toString();
	else
	    return values.firstElement().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 keyCombi == none;
    }

}

--- NEW FILE: CssColumnRuleWidth.java ---
//
// $Id: CssColumnRuleWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssBorderWidth;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;border-width&gt; || inherit<BR>
 *  <EM>Initial:</EM>medium<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssColumnRuleWidth extends CssProperty {

    CssBorderWidth value;

    /**
     * Create a new CssColumnRuleWidth
     */
    public CssColumnRuleWidth() {
	// nothing to do
    }

    /**
     * Create a new CssColumnRuleWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssColumnRuleWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	try {
	    value = new CssBorderWidth(ac, expression);
	    expression.next();
	}
	catch (InvalidParamException e) {
	    throw new InvalidParamException("value",
					    expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssColumnRuleWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssColumnRuleWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssColumnRuleWidth = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getColumnRuleWidth();
	}
	else {
	    return ((Css3Style) style).cssColumnRuleWidth;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "column-border-width";
    }

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

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

    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return false;
    }

}

--- NEW FILE: CssFontEmphasize.java ---
//
// $Id: CssFontEmphasize.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * <P>
 * <EM>Value:</EM> &lt;font-emphasize-style&gt; || &lt;font-emphasize-position&gt; || inherit<BR>
 * <EM>Initial:</EM>see individual properties<BR>
 * <EM>Applies to:</EM>all elements or replaced elements??<BR>
 * <EM>Inherited</EM>yes<BR>
 * <EM>Percentages:</EM>no<BR>
 * <EM>Media:</EM>visual
 * <P>
 * This is a shorthand property for setting the style and position of the font emphasis decoration. 
 */

public class CssFontEmphasize extends CssProperty 
implements CssOperator {
    
    CssValue fontemph;
    CssFontEmphasizePos fep;
    CssFontEmphasizeStyle fes;

    /**
     * Creates a new CssFontEmphasize
     */
    public CssFontEmphasize() {	
    }
    
    /**
     * Creates a new CssFontEmphasize
     *
     * @param expression The expression for this property
     * @exception InvalidParamException The expression is incorrect
     */
    public CssFontEmphasize(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	CssValue val = expression.getValue();
	int maxvalues = 2;
	boolean correct = true;
	char op = SPACE;

	while (correct && (val != null) && (maxvalues-- > 0)) {
	    
	    correct = false;

	    if (fep == null) {
		try {
		    fep = new CssFontEmphasizePos(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (fes == null) {
		try {
		    fes = new CssFontEmphasizeStyle(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct) {
		throw new InvalidParamException("value", expression.getValue(),
						getPropertyName(), ac);
	    }
	    
	    val = expression.getValue();
	    op = expression.getOperator();

	}

    }

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

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssFontEmphasize != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssFontEmphasize = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getFontEmphasize();
	}
	else {
	    return ((Css3Style) style).cssFontEmphasize;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return false;
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "font-emphasize";
    }

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

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	String ret = "";
	if (fes.isByUser()) {
	    ret += " " + fes;
	}
	if (fep.isByUser()) {
	    ret += " " + fep;
	}
	return ret.substring(1);
    }

    /*
       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 fontemph == none;
       }
    */
}

--- NEW FILE: CssWordBreakCJK.java ---
//
// $Id: CssWordBreakCJK.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> normal || break-all || keep-all || inherit<BR>
 *  <EM>Initial:</EM>normal<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property controls line-breaking behavior inside of words from a CJK 
 *  point of view. 
 */

public class CssWordBreakCJK extends CssProperty {
    
    CssValue wordbreak;

    CssIdent normal = new CssIdent("normal");
    CssIdent breakall = new CssIdent("break-all");
    CssIdent keepall = new CssIdent("keep-all");
    
    /**
     * Create a new CssWordBreakCJK
     */
    public CssWordBreakCJK() {
	wordbreak = normal;
    }
    
    /**
     * Create a new CssWordBreakCJK
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssWordBreakCJK(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(normal)) {
	    wordbreak = normal;
	    expression.next();
	}
	else if (val.equals(keepall)) {
	    wordbreak = keepall;	
    	    expression.next();
	}
	else if (val.equals(breakall)) {
	    wordbreak = breakall;	
    	    expression.next();
	}
	else if (val.equals(inherit)) {
	    wordbreak = inherit;
     	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssWordBreakCJK(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssWordBreakCJK != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssWordBreakCJK = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getWordBreakCJK();
	}
	else {
	    return ((Css3Style) style).cssWordBreakCJK;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssWordBreakCJK &&
		wordbreak.equals(((CssWordBreakCJK) property).wordbreak));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "word-break-CJK";
    }

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

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

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

    /**
     * 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 wordbreak == normal;
    }

}
	    

--- NEW FILE: CssAllSpaceTreatment.java ---
//
// $Id: CssAllSpaceTreatment.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 */
public class CssAllSpaceTreatment extends CssProperty {
    
    CssValue spacetreat;
    
    private static CssIdent preserve = new CssIdent("collapse");
    private static CssIdent collapse = new CssIdent("preserve");
    
    /**
     * Create a new CssAllSpaceTreatment
     */
    public CssAllSpaceTreatment() {
	spacetreat = collapse;
    }
    
    /**
     * Create a new CssAllSpaceTreatment
     *
     *
     */
    public CssAllSpaceTreatment(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(preserve)) {
	    spacetreat = preserve;
	    expression.next();
	}
	else if (val.equals(collapse)) {
	    spacetreat = collapse;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    spacetreat = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssAllSpaceTreatment(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssAllSpaceTreatment != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssAllSpaceTreatment = this;
	
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getAllSpaceTreatment();
	} else {
	    return ((Css3Style) style).cssAllSpaceTreatment;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssAllSpaceTreatment &&
		spacetreat.equals( ((CssAllSpaceTreatment) property).spacetreat));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "all-space-treatment";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return spacetreat;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return spacetreat.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return spacetreat.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 spacetreat == collapse;
    }
    
}

--- NEW FILE: Css3Property.java ---
//
// $Id: Css3Property.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, Keio University)
// Please first read the full copyright statement in the file COPYRIGHT.html

package org.w3c.css.properties.css3;

import org.w3c.css.properties.css1.CssProperty;

public abstract class Css3Property extends CssProperty {

   /**
    * Returns true if the property is inherited
    */
   public boolean Inherited() {
      return Css3Properties.getInheritance(this);
   }

}

--- NEW FILE: CssBoxShadow.java ---
//
// $Id: CssBoxShadow.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssColor;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssLength;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;



public class CssBoxShadow extends CssProperty implements CssOperator {
    
    String value = "";
    ApplContext ac;
    CssIdent none = new CssIdent("none");
    
    /**
     * Create new CssBoxShadow
     */
    public CssBoxShadow() {
	value = "none";
    }
    
    /**
     * Create new CssBoxShadow
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBoxShadow(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	char op = COMMA;
	
	if (val instanceof CssIdent) {
	    if (val.equals(none)) {
		value = "none";
		expression.next();
	    } else if (val.equals(inherit)) {
		value = "inherit";
		expression.next();
	    }
	} else {
	    
	    // <length> <length> <length>? || <color> [, <length> <length> <length>? || <color>]+
	    
	    int lengthcounter = 0;
	    int runs = 1;
	    
	    for (int i = 0; i < expression.getCount(); i++) {
		
		if (op != COMMA) {
		    throw new InvalidParamException("operator",
			    ((new Character(op)).toString()), ac);
		} else if (runs != 1) {
		    value += ", ";
		}
		
		val = expression.getValue();
		
		if (val != null) {
		    
		    while (val instanceof CssLength && lengthcounter < 3) {
			value += val.toString() + " ";
			expression.next();
			i++;
			val = expression.getValue();
			lengthcounter++;
		    }
		    
		    if (lengthcounter == 2 || lengthcounter == 3) {
			if (val instanceof CssColor) {
			    value += val.toString() + " ";
			} else {
			    value += (new org.w3c.css.values.CssColor(ac, (String) val.get())).toString() + " ";
			}
		    } else {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		} else {
		    
		    if (runs < 2) {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		    
		    value = value.trim();
		    return;
		}
		
		op = expression.getOperator();
		lengthcounter = 0;
		expression.next();
		runs++;
	    }
	}
    }
    
    public CssBoxShadow(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBoxShadow != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBoxShadow = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBoxShadow();
	} else {
	    return ((Css3Style) style).cssBoxShadow;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBoxShadow &&
		value.equals( ((CssBoxShadow) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "box-shadow";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * 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 value.equals(none);
    }

}

--- NEW FILE: CssDropInitialBeforeAdjust.java ---
//
// $Id: CssDropInitialBeforeAdjust.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || &lt;percentage&gt; || &lt;length&gt; || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>refers to the 'line-height' of the element<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'alignment-adjust' property allows more precise alignment of
 *  elements, such as graphics, that do not have a baseline-table
 *  or lack the desired baseline in their baseline-table. With the
 *  'alignment-adjust' property, the position of the baseline
 *  identified by the 'alignment-baseline' can be explicitly determined.
 */

public class CssDropInitialBeforeAdjust extends CssProperty {

    CssValue dropvalue;

    CssIdent textbeforeedge = new CssIdent("text-before-edge");

    private static String[] values = {
	"before-edge", "text-before-edge", "middle", "central", "after-edge", "text-after-edge",
	"ideographic", "hanging", "mathematical", "inherit", "initial"
    };

    /**
     * Create a new CssDropInitialBeforeAdjust
     */
    public CssDropInitialBeforeAdjust() {
	dropvalue = textbeforeedge;
    }

    /**
     * Create a new CssDropInitialBeforeAdjust
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssDropInitialBeforeAdjust(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssIdent) {
	    int i = 0;
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    dropvalue = val;
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else if (val instanceof CssPercentage) {
	    dropvalue = val;
	    expression.next();
	}
	else if (val instanceof CssLength) {
	    dropvalue = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }

    public CssDropInitialBeforeAdjust(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssDropInitialBeforeAdjust != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssDropInitialBeforeAdjust = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getDropInitialBeforeAdjust();
	}
	else {
	    return ((Css3Style) style).cssDropInitialBeforeAdjust;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "drop-initial-before-adjust";
    }

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

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

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

    /**
     * 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 dropvalue == textbeforeedge;
    }

}

--- NEW FILE: CssBorderBottomRightImage.java ---
//
// $Id: CssBorderBottomRightImage.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;



public class CssBorderBottomRightImage extends CssProperty {
    
    String value = "";
    ApplContext ac;
    CssIdent contin = new CssIdent("continue");
    CssIdent none = new CssIdent("none");
    
    /**
     * Create new CssBorderBottomRightImage
     */
    public CssBorderBottomRightImage() {
	value = "continue";
    }
    
    /**
     * Create new CssBorderBottomRightImage
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderBottomRightImage(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val != null) {
	    if (val.equals(none)) {
		value = "none";
	    } else if (val.equals(contin)) {
		value = "continue";
	    } else if (val instanceof CssURL) {
		value = val.toString();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	expression.next();
    }
    
    public CssBorderBottomRightImage(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomRightImage != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomRightImage = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomRightImage();
	} else {
	    return ((Css3Style) style).cssBorderBottomRightImage;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomRightImage &&
		value.equals( ((CssBorderBottomRightImage) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-left-image";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: MediaMaxColorIndex.java ---
//
// $Id: MediaMaxColorIndex.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMaxColorIndex.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:05:40  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMaxColorIndex extends CssProperty implements CssOperator {

    CssValue value;

    /**
     * Create a new MediaMaxColorIndex
     */
    public MediaMaxColorIndex() {
		//empty
    }

    /**
     * Create a new MediaMaxColorIndex.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMaxColorIndex(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	char op = SPACE;
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaMaxColorIndex(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "max-color-index";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMaxColorIndex != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMaxColorIndex = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMaxColorIndex();
	} else {
	    return ((Css3Style) style).mediaMaxColorIndex;
	}
    }

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

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

}

--- NEW FILE: MediaMinResolution.java ---
//
// $Id: MediaMinResolution.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMinResolution.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:02:55  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssResolution;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMinResolution extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMinResolution
     */
    public MediaMinResolution() {
		//empty
    }

    /**
     * Create a new MediaMinResolution.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMinResolution(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssResolution) {
		value = val;
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaMinResolution(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-resolution";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMinResolution != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMinResolution = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMinResolution();
	} else {
	    return ((Css3Style) style).mediaMinResolution;
	}
    }

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

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

}

--- NEW FILE: MediaMinColorIndex.java ---
//
// $Id: MediaMinColorIndex.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMinColorIndex.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:02:55  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMinColorIndex extends CssProperty implements CssOperator {

    CssValue value;

    /**
     * Create a new MediaMinColorIndex
     */
    public MediaMinColorIndex() {
		//empty
    }
    
    /**
     * Create a new MediaMinColorIndex.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMinColorIndex(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	char op = SPACE;
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaMinColorIndex(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-color-index";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMinColorIndex != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMinColorIndex = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMinColorIndex();
	} else {
	    return ((Css3Style) style).mediaMinColorIndex;
	}
    }

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

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

}

--- NEW FILE: CssBorderBottomFitWidth.java ---
//
// $Id: CssBorderBottomFitWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderBottomFitWidth extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderBottomFitWidth
     */
    public CssBorderBottomFitWidth() {
	value = "repeat";
    }
    
    /**
     * Create a new CssBorderBottomFitWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderBottomFitWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderBottomFitWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomFitWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomFitWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomFitWidth();
	}
	else {
	    return ((Css3Style) style).cssBorderBottomFitWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomFitWidth &&
		value.equals(((CssBorderBottomFitWidth) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-fit-width";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }
    
}

--- NEW FILE: CssTextAfterOverflow.java ---
//
// $Id: CssTextAfterOverflow.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> clip || ellipsis || ellipsis-word || ellipsis-path || fade || inherit<BR>
 *  <EM>Initial:</EM>clip<BR>
 *  <EM>Applies to:</EM>all block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property controls whether or not text wraps when it reaches the flow 
 *  edge of its containing block box.
 */

public class CssTextAfterOverflow extends CssProperty {
 
    CssValue overflow;
    ApplContext ac;

    static CssIdent clip = new CssIdent("clip");
    static CssIdent ellipsis = new CssIdent("ellipsis");
    static CssIdent ellipsisword = new CssIdent("ellipsis-word");
    static CssIdent ellipsispath = new CssIdent("ellipsis-path");
    static CssIdent fade = new CssIdent("fade");

    /**
     * Create a new CssTextAfterOverflow
     */
    public CssTextAfterOverflow() {
	overflow = clip;
    }

    /**
     * Create a new CssTextAfterOverflow
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextAfterOverflow(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(clip)) {
	    overflow = clip;
	    expression.next();
	}
	else if (val.equals(ellipsis)) {
	    overflow = ellipsis;
	    expression.next();
	}
	else if (val.equals(ellipsisword)) {
	    overflow = ellipsisword;
	    expression.next();
	}
	else if (val.equals(ellipsispath)) {
	    overflow = ellipsispath;
	    expression.next();
	}
        else if (val.equals(fade)) {
            overflow = fade;
            expression.next();
        }
	else if (val.equals(inherit)) {
	    overflow = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }

    public CssTextAfterOverflow(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextAfterOverflow != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextAfterOverflow = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextAfterOverflow();
	}
	else {
	    return ((Css3Style) style).cssTextAfterOverflow;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextAfterOverflow &&
		overflow.equals(((CssTextAfterOverflow) property).overflow));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-after-overflow";
    }

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

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

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

    /**
     * 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 overflow == clip;
    }

}

--- NEW FILE: CssBackgroundClip.java ---
//
// $Id: CssBackgroundClip.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche Smeman (sijtsche@wisdom.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> border || padding<BR>
 *  <EM>Initial:</EM>border<BR>
 *  <EM>Applies to:</EM>block-level and replaced elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  Determines whether the background extents into the border area or not. If the value is
 *  'padding', the background is clipped to the padding edge and the background of the border
 *  is transparent.
 */

public class CssBackgroundClip extends CssProperty {
    
    CssValue bgclip;
    
    CssIdent border = new CssIdent("border");
    CssIdent padding = new CssIdent("padding");
    
    /**
     * Create a new CssBackgroundClip
     */
    public CssBackgroundClip() {
	bgclip = border;
    }
    
    /**
     * Create a new CssBackgroundClip
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBackgroundClip(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(border)) {
	    bgclip = border;
	    expression.next();
	} else if (val.equals(padding)) {
	    bgclip = padding;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBackgroundClip(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBackgroundClip != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBackgroundClip = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getCssBackgroundClip();
	}
	else {
	    return ((Css3Style) style).cssBackgroundClip;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBackgroundClip &&
		bgclip.equals(((CssBackgroundClip) property).bgclip));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "background-clip";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return bgclip;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return bgclip.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return bgclip.toString();
    }
    
    /**
     * 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 bgclip == border;
    }
    
}

--- NEW FILE: CssMarqueeRepetition.java ---
//
// $Id: CssMarqueeRepetition.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssValue;

public class CssMarqueeRepetition extends CssProperty {

    CssValue mrep;

    static CssIdent infinite = new CssIdent("infinite");
    static CssIdent initial = new CssIdent("initial");


    /**
     * Create a new CssMarqueeRepetition
     */
    public CssMarqueeRepetition() {
	mrep = infinite;
    }

    /**
     * Create a new CssMarqueeRepetition
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssMarqueeRepetition(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(infinite)) {
	    mrep = infinite;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    mrep = inherit;
	    expression.next();
	} else if (val instanceof CssNumber && ((CssNumber) val).isInteger() ) {
	    
	    mrep = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value",
		    expression.getValue(),
		    getPropertyName(), ac);
	}
	
    }
    
    public CssMarqueeRepetition(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }    
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssMarqueeRepetition != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssMarqueeRepetition = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMarqueeRepetition();
	}
	else {
	    return ((Css3Style) style).cssMarqueeRepetition;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "marquee-repetition";
    }

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

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

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

    /**
     * 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 mrep == infinite;
    }

}

--- NEW FILE: CssTextUnderLine.java ---
//
// $Id: CssTextUnderLine.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;style&gt; || &lt;color&gt; || &lt;mode&gt; || 
 *  &lt;position&gt; || inherit<BR>
 *  <EM>Initial:</EM>not defined for shorthand properties<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property is the shorthand for 'text-underline-style', 
 *  'text-underline-color', 'text-underline-mode' and 'text-underline-position'.
 */

public class CssTextUnderLine extends CssProperty 
implements CssOperator  {
 
    CssValue underline;
    CssTextUlColor tuc;
    CssTextUlMode tum;
    CssTextUlPos tup;
    CssTextUlStyle tus;

    /**
     * Create a new CssTextUnderLine
     */
    public CssTextUnderLine() {
    }

    /**
     * Create a new CssTextUnderLine
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextUnderLine(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	CssValue val = expression.getValue();
	int maxvalues = 4;
	boolean correct = true;
	char op = SPACE;

	while (correct && (val != null) && (maxvalues-- > 0)) {

	    correct = false;
	 
	    if (tus == null) {
		try {
		    tus = new CssTextUlStyle(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && tuc == null) {
		try {
		    tuc = new CssTextUlColor(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && tum == null) {
		try {
		    tum = new CssTextUlMode(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && tup == null) {
		try {
		    tup = new CssTextUlPos(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct) {
		throw new InvalidParamException("value", 
						expression.getValue(), 
						getPropertyName(), ac);
	    }

	    val = expression.getValue();
	    op = expression.getOperator();
	}

	if (tuc == null) {
	    tuc = new CssTextUlColor();
	}
	if (tum == null) {
	    tum = new CssTextUlMode();
	}
	if (tup == null) {
	    tup = new CssTextUlPos();
	}
	if (tus == null) {
	    tus = new CssTextUlStyle();
	}

    }

    public CssTextUnderLine(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextUnderLine != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextUnderLine = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextUnderLine();
	}
	else {
	    return ((Css3Style) style).cssTextUnderLine;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return false;
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-underline";
    }

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	
	String ret = "";
	if (tus.isByUser()) {
	    ret += " " + tus;
	}
	if (tuc.isByUser()) {
	    ret += " " + tuc;
	}
	if (tum.isByUser()) {
	    ret += " " + tum;
	}
	if (tup.isByUser()) {
	    ret += " " + tup;
	}
	return ret.substring(1);
    }
}

--- NEW FILE: CssPaddingLeftCSS3.java ---
//
// $Id: CssPaddingLeftCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssPaddingLeftCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/12/24 13:20:53  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:13:59  plehegar
 * Freeze
 *
 * Revision 1.4  1997/08/20 11:41:27  plehegar
 * Freeze
 *
 * Revision 1.3  1997/08/06 17:30:15  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:20:15  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/24 01:31:29  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 *   <H4>
 *     <A NAME="padding-left">5.5.9 &nbsp;&nbsp; 'padding-left'</A>
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> &lt;length&gt; | &lt;percentage&gt;<BR>
 *   <EM>Initial:</EM> 0<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> refer to parent element's width<BR>
 *   <P>
 *   This property sets the left padding of an element.
 *   <PRE>
 *   BLOCKQUOTE { padding-left: 20% }
 * </PRE>
 *   <P>
 *   Padding values cannot be negative.
 * @version $Revision: 1.1 $
 */
public class CssPaddingLeftCSS3 extends CssPaddingSideCSS3 {
    
    /**
     * Create a new CssPaddingLeftCSS3
     */
    public CssPaddingLeftCSS3() {
	super();
    }
    
    /**
     * Create a new CssPaddingLeftCSS3 with an another CssPaddingSideCSS3
     * @param another The another side.
     */
    public CssPaddingLeftCSS3(CssPaddingSideCSS3 another) {
	super(another);
    }
    
    /**
     * Create a new CssPaddingLeftCSS3
     *
     * @param expression The expression for this property.
     * @exception InvalidParamException Values are incorrect
     */
    public CssPaddingLeftCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	super(ac, expression, check);
    }
    
    public CssPaddingLeftCSS3(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "padding-left";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssPaddingLeftCSS3 != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssPaddingLeftCSS3 = this;
	
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getPaddingLeftCSS3();
	} else {
	    return ((Css3Style) style).cssPaddingCSS3.getLeft();
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssPaddingLeftCSS3 &&
		value.equals(((CssPaddingLeftCSS3) property).value));
    }
    
}

--- NEW FILE: MediaMaxWidth.java ---
//
// $Id: MediaMaxWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMaxWidth.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:04:22  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMaxWidth extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMaxWidth
     */
    public MediaMaxWidth() {
		//empty
    }

    /**
     * Create a new MediaMaxWidth.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMaxWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaMaxWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "max-width";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMaxWidth != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMaxWidth = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMaxWidth();
	} else {
	    return ((Css3Style) style).mediaMaxWidth;
	}
    }

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

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

}

--- NEW FILE: CssClearCSS3.java ---
//
// $Id: CssClearCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssClearCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.3  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/12/24 13:05:56  sijtsche
 * value initial added
 *
 * Revision 1.1  2002/07/19 20:30:12  sijtsche
 * files representing CSS3 properties
 *
 * Revision 1.1  2002/05/08 09:30:52  dejong
 * CSS version 3 specific properties as in March 2002, all modules
 *
 * Revision 3.1  1997/08/29 13:13:43  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:20  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:13  plehegar
 * Nothing
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *   <H4>
 *     <A NAME="clear">5.5.26 &nbsp;&nbsp; 'clear'</A>
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> none | left | right | both<BR>
 *   <EM>Initial:</EM> none<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> N/A<BR>
 *   <P> This property specifies if an element allows floating elements on its
 *   sides.  More specifically, the value of this property lists the sides where
 *   floating elements are not accepted. With 'clear' set to 'left', an element
 *   will be moved below any floating element on the left side. With 'clear' set
 *   to 'none', floating elements are allowed on all sides. Example:
 *   <PRE>
 *   H1 { clear: left }
 *  </PRE>
 *
 * @version $Revision: 1.1 $ */
public class CssClearCSS3 extends CssProperty {

    int value;

    private static String[] CLEAR = {
	"none", "left", "right", "both", "inherit",
	"top", "bottom", "inside", "outside", "start", "end", "initial", "inherit"
    };

    private static int[] hash_values;

    /**
     * Create a new CssClearCSS3
     */
    public CssClearCSS3() {
	// nothing to do
    }

    /**
     * Create a new CssClearCSS3
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssClearCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();
	if ( val instanceof CssIdent) {
	    int hash = val.hashCode();
	    for (int i = 0; i < CLEAR.length; i++)
		if (hash_values[i] == hash) {
		    value = i;
		    expression.next();
		    return;
		}
	}
	throw new InvalidParamException("value", expression.getValue(),
					getPropertyName(), ac);
    }

    public CssClearCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return CLEAR[value];
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "clear";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return value == CLEAR.length - 1;
    }

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

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssClearCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssClearCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getClearCSS3();
	} else {
	    return ((Css3Style) style).cssClearCSS3;
	}
    }

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

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

    static {
	hash_values = new int[CLEAR.length];
	for (int i = 0; i < CLEAR.length; i++)
	    hash_values[i] = CLEAR[i].hashCode();
    }
}

--- NEW FILE: CssInlineBoxAlign.java ---
//
// $Id: CssInlineBoxAlign.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *
 */

public class CssInlineBoxAlign extends CssProperty {

    CssValue inlineboxalign;

    private static CssIdent initial = new CssIdent("initial");
    private static CssIdent last = new CssIdent("last");

    /**
     * Create a new CssInlineBoxAlign
     */
    public CssInlineBoxAlign() {
		inlineboxalign = initial;
    }

    /**
     * Create a new CssInlineBoxAlign
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssInlineBoxAlign(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(initial)) {
	    inlineboxalign = initial;
	    expression.next();
	}
	else if (val.equals(last)) {
	    inlineboxalign = last;
	    expression.next();
	}
	else if (val instanceof CssNumber) {
	    inlineboxalign = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }

    public CssInlineBoxAlign(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssInlineBoxAlign != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssInlineBoxAlign = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getInlineBoxAlign();
	}
	else {
	    return ((Css3Style) style).cssInlineBoxAlign;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "inline-box-align";
    }

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

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

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

    /**
     * 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 inlineboxalign == initial;
    }

}

--- NEW FILE: CssColumnGap.java ---
//
// $Id: CssColumnGap.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *
 */

    public class CssColumnGap extends CssProperty {

	CssValue columngap;


	/**
	 * Create a new CssColumnGap
	 */
	public CssColumnGap() {
	    columngap = new CssNumber(0);
	}

	/**
	 * Create a new CssColumnGap
	 *
	 *
	 */
	public CssColumnGap(ApplContext ac, CssExpression expression,
		boolean check) throws InvalidParamException {
	    setByUser();
	    CssValue val = expression.getValue();
	    if (val instanceof CssPercentage) {
			columngap = val;
			expression.next();
	    }
	    else if (val instanceof CssLength) {
			columngap = val;
			expression.next();
	    }
	    else if (val.equals(inherit)) {
			columngap = inherit;
			expression.next();
	    }

	    else {
		throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	    }
	}

	public CssColumnGap(ApplContext ac, CssExpression expression)
		throws InvalidParamException {
	    this(ac, expression, false);
	}
	
	/**
	 * Add this property to the CssStyle.
	 *
	 * @param style The CssStyle
	 */
	public void addToStyle(ApplContext ac, CssStyle style) {
	    if (((Css3Style) style).cssColumnGap != null)
		style.addRedefinitionWarning(ac, this);
	    ((Css3Style) style).cssColumnGap = this;

	}

	/**
	 * Get this property in the style.
	 *
	 * @param style The style where the property is
	 * @param resolve if true, resolve the style to find this property
	 */
        public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	    if (resolve) {
		return ((Css3Style) style).getColumnGap();
	    } else {
		return ((Css3Style) style).cssColumnGap;
	    }
	}

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

	/**
	 * Returns the name of this property
	 */
	public String getPropertyName() {
	    return "column-gap";
	}

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

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

	/**
	 * Returns a string representation of the object
	 */
	public String toString() {
	    return columngap.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 columngap == new CssNumber(0);
	}

    }

--- NEW FILE: MediaDeviceWidth.java ---
//
// $Id: MediaDeviceWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaDeviceWidth.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:05:40  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaDeviceWidth extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaDeviceWidth
     */
    public MediaDeviceWidth() {
		//empty
    }

    /**
     * Create a new MediaDeviceWidth.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaDeviceWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaDeviceWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "device-width";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaDeviceWidth != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaDeviceWidth = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaDeviceWidth();
	} else {
	    return ((Css3Style) style).mediaDeviceWidth;
	}
    }

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

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

}

--- NEW FILE: CssLinkBehavior.java ---
//
// $Id: CssLinkBehavior.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> normal | pop-up | confirm | expand | none | inherit<BR>
 *  <EM>Initial:</EM>baseline<BR>
 *  <EM>Applies to:</EM>link elements and collapsed elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:all
 *  <P>
 *  This property determines what the UA will do with a link element or a collapsed 
 *  element (see 'collapse').
 */

public class CssLinkBehavior extends CssProperty {

    CssValue behavior;

    static CssIdent normal = new CssIdent("normal");

    private static String[] values = {
	"normal", "pop-up", "confirm", "expand", "none", "inherit"
    };

    /**
     * Create a new CssLinkBehavior
     */
    public CssLinkBehavior() {
	// nothing to do
    }

    /**
     * Create a new CssLinkBehavior
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssLinkBehavior(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		behavior = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssLinkBehavior(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssLinkBehavior != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssLinkBehavior = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getLinkBehavior();
	}
	else {
	    return ((Css3Style) style).cssLinkBehavior;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssLinkBehavior &&
		behavior.equals(((CssLinkBehavior) property).behavior));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "link-behavior";
    }

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

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

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

    /**
     * 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 (behavior == normal);
    }

}

--- NEW FILE: CssTextOLStyle.java ---
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM>  none | solid | double | dotted | thick | dashed | dot-dash | dot-dot-dash | wave | inherit<BR>
 *  <EM>Initial:</EM>solid<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies the overline style to use when 'text-decoration' 
 *  is set to 'overline'.
 */

public class CssTextOLStyle extends CssProperty {
 
    CssValue olstyle;

    static CssIdent solid = new CssIdent("solid");

    private static String[] values = {
	"none", "solid", "double", "dotted", "thick", "dashed", "dot-dash", 
	"dot-dot-dash", "wave", "inherit"
    };

    /**
     * Create a new CssTextOLStyle
     */
    public CssTextOLStyle() {
	olstyle = solid;
    }

    /**
     * Create a new CssTextOLStyle
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextOLStyle(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	int i = 0;
	for (;i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		olstyle = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", 
					    expression.getValue(), 
					    getPropertyName(), ac);
	}
    }

    public CssTextOLStyle(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextOLStyle != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextOLStyle = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextOLStyle();
	}
	else {
	    return ((Css3Style) style).cssTextOLStyle;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextOLStyle &&
		olstyle.equals(((CssTextOLStyle) property).olstyle));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-overline-style";
    }

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

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

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

    /**
     * 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 olstyle == solid;
    }

}

--- NEW FILE: CssTextEndOverflow.java ---
//
// $Id: CssTextEndOverflow.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> clip || ellipsis || ellipsis-word || ellipsis-path || fade || inherit<BR>
 *  <EM>Initial:</EM>clip<BR>
 *  <EM>Applies to:</EM>all block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property controls whether or not text wraps when it reaches the flow 
 *  edge of its containing block box.
 */

public class CssTextEndOverflow extends CssProperty {
 
    CssValue overflow;
    ApplContext ac;

    static CssIdent clip = new CssIdent("clip");
    static CssIdent ellipsis = new CssIdent("ellipsis");
    static CssIdent ellipsisword = new CssIdent("ellipsis-word");
    static CssIdent ellipsispath = new CssIdent("ellipsis-path");
    static CssIdent fade = new CssIdent("fade");

    /**
     * Create a new CssTextEndOverflow
     */
    public CssTextEndOverflow() {
	overflow = clip;
    }

    /**
     * Create a new CssTextEndOverflow
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextEndOverflow(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(clip)) {
	    overflow = clip;
	    expression.next();
	}
	else if (val.equals(ellipsis)) {
	    overflow = ellipsis;
	    expression.next();
	}
	else if (val.equals(ellipsisword)) {
	    overflow = ellipsisword;
	    expression.next();
	}
	else if (val.equals(ellipsispath)) {
	    overflow = ellipsispath;
	    expression.next();
	}
        else if (val.equals(fade)) {
            overflow = fade;
            expression.next();
        }
	else if (val.equals(inherit)) {
	    overflow = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }

    public CssTextEndOverflow(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextEndOverflow != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextEndOverflow = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextEndOverflow();
	}
	else {
	    return ((Css3Style) style).cssTextEndOverflow;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextEndOverflow &&
		overflow.equals(((CssTextEndOverflow) property).overflow));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-end-overflow";
    }

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

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

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

    /**
     * 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 overflow == clip;
    }

}

--- NEW FILE: CssColumnWidthPol.java ---
//
// $Id: CssColumnWidthPol.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> flexible || strict || inherit<BR>
 *  <EM>Initial:</EM>flexible<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property describes how to interpret 'column-width'. The 'flexible' 
 *  value indicates that the width of columns can be increased to fill all 
 *  the available space. The 'strict' value indicates that 'column-width' is 
 *  to be honored. 
 */

public class CssColumnWidthPol extends CssProperty {

    CssValue policy;

    static CssIdent flexible = new CssIdent("flexible");

    private static String[] values = {
	"flexible", "strict", "inherit"
    };

    /**
     * Create a new CssColumnWidthPol
     */
    public CssColumnWidthPol() {
	// nothing to do
    }

    /**
     * Create a new CssColumnWidthPol
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssColumnWidthPol(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		policy = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssColumnWidthPol(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssColumnWidthPol != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssColumnWidthPol = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getColumnWidthPol();
	}
	else {
	    return ((Css3Style) style).cssColumnWidthPol;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssColumnWidthPol &&
		policy.equals(((CssColumnWidthPol) property).policy));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "column-width-policy";
    }

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

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

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

    /**
     * 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 (policy == flexible);
    }

}

--- NEW FILE: CSS3Default.properties ---
# inherited : true if this property is inherited ...

opacity.inherited:			false
color-profile.inherited:		true
rendering-intent.inherited:		true
font-effect.inherited:			true
font-smooth.inherited:			true
font-emphasize-style.inherited:		true
font-emphasize-position.inherited:	true
font-emphasize.inherited:		true
ruby-position.inherited:		true	
ruby-align.inherited:			true
ruby-overhang.inherited:		true
box-sizing.inherited:			false
resizer.inherited:			false
key-equivalent.inherited:		false
tab-index.inherited:			false
user-input.inherited:			false
user-modify.inherited:			true
user-select.inherited:			false
user-focus.inherited:			true
user-focus-key.inherited:		true
user-focus-pointer.inherited:		true
toggle-group.inherited:			false
group-reset.inherited:			false
writing-mode.inherited:			true
glyph-orientation-vertical.inherited:	true
glyph-orientation-horizontal.inherited:	true
text-justify.inherited:			true
text-align-last.inherited:		true
min-font-size.inherited:		true
max-font-size.inherited:		true
text-justify-trim.inherited:		true
text-kashida-space.inherited:		true
dominant-baseline.inherited:		false
alignment-baseline.inherited:		false
alignment-adjust.inherited:		false
baseline-shift.inherited:		false
line-break.inherited:			true
word-break-cjk.inherited:		true
word-break-wrap.inherited:		true
word-break-inside.inherited:		true
word-break.inherited:			true
text-space.inherited:			true
text-wrap.inherited:			true
text-end-overflow.inherited:		false
text-after-overflow.inherited:		false
punctuation-trim.inherited:		true
text-autospace.inherited:		true
kerning-mode.inherited:			true
kerning-pair-treshold.inherited:	true
text-underline-style.inherited:		false
text-underline-color.inherited:		false
text-underline-mode.inherited:		false
text-underline-position.inherited:	false
text-underline.inherited:		false
text-line-through-style.inherited:	false
text-line-through-color.inherited:	false
text-line-through-mode.inherited:	false
text-line-through.inherited:		false
text-overline-style.inherited:		false
text-overline-color.inherited:		false
text-overline-mode.inherited:		false
text-overline.inherited:		false
layout-grid-type.inherited:		true
layout-grid-line.inherited:		true
layout-grid-mode.inherited:		true
layout-grid-char.inherited:		true
layout-grid.inherited:			true
punctuation-wrap.inherited:		true
text-combine.inherited:			false
text-fit.inherited:			false
media.inherited:			false

--- NEW FILE: CssUserFocusPointer.java ---
//
// $Id: CssUserFocusPointer.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || normal || select-all || select-before ||
 *  select-after || select-same || select-menu || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:interactive
 *  <P>
 *  The purpose of this property is to determine what happens to an element 
 *  when the user focusses it specifically by "tabbing" into it.
 */

public class CssUserFocusPointer extends CssProperty {

    CssValue userfocuspointer;

    static CssIdent auto = new CssIdent("auto");
    static CssIdent normal = new CssIdent("normal");
    static CssIdent selectall = new CssIdent("select-all");
    static CssIdent selectbefore = new CssIdent("select-before");
    static CssIdent selectafter = new CssIdent("select-after");
    static CssIdent selectsame = new CssIdent("select-same");
    static CssIdent selectmenu = new CssIdent("select-menu");

    /**
     * Create a new CssUserFocusPointer
     */
    public CssUserFocusPointer() {
	userfocuspointer = auto;
    }

    /**
     * Create a new CssUserFocusPointer
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssUserFocusPointer(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(auto)) {
	    userfocuspointer = auto;
	    expression.next();
	}
	else if (val.equals(normal)) {
	    userfocuspointer = normal;
	    expression.next();
	}
	else if (val.equals(selectall)) {
	    userfocuspointer = selectall;
	    expression.next();
	}
	else if (val.equals(selectbefore)) {
	    userfocuspointer = selectbefore;
	    expression.next();
	}
	else if (val.equals(selectafter)) {
	    userfocuspointer = selectafter;
	    expression.next();
	}
	else if (val.equals(selectsame)) {
	    userfocuspointer = selectsame;
	    expression.next();
	}
	else if (val.equals(selectmenu)) {
	    userfocuspointer = selectmenu;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    userfocuspointer = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssUserFocusPointer(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssUserFocusPointer != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssUserFocusPointer = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getUserFocusPointer();
	}
	else {
	    return ((Css3Style) style).cssUserFocusPointer;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssUserFocusPointer &&
		userfocuspointer.equals(((CssUserFocusPointer) property).userfocuspointer));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "user-focus-pointer";
    }

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

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

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

    /**
     * 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 userfocuspointer == auto;
    }

}



--- NEW FILE: CssMinHeightCSS3.java ---
//
// $Id: CssMinHeightCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 */
public class CssMinHeightCSS3 extends CssProperty {

    CssValue value;
    private static CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssMinHeightCSS3
     */
    public CssMinHeightCSS3() {
    }

    /**
     * Create a new CssMinHeightCSS3.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssMinHeightCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
 	} else if (val.equals(initial)) {
		value = initial;
	} else if (val instanceof CssLength || val instanceof CssPercentage) {
	    float f = ((Float) val.get()).floatValue();
	    if (f < 0) {
		throw new InvalidParamException("negative-value",
						val.toString(), ac);
	    }
	    value = val;
	} else if (val instanceof CssNumber) {
	    value = ((CssNumber) val).getLength();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}

	expression.next();
    }

    public CssMinHeightCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-height";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssMinHeightCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssMinHeightCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMinHeightCSS3();
	} else {
	    return ((Css3Style) style).cssMinHeightCSS3;
	}
    }

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

}

--- NEW FILE: CssAlignmentBaseLine.java ---
//
// $Id: CssAlignmentBaseLine.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> baseline || auto-script || before-edge ||
 *  text-before-edge || after-edge || text-after-edge || middle ||
 *  ideographic || lower || hanging || mathematical || inherit<BR>
 *  <EM>Initial:</EM>baseline<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies how an inline-level element is aligned with
 *   respect to its parent.
 */

public class CssAlignmentBaseLine extends CssProperty {

    CssValue albaseline;

    static CssIdent baseline = new CssIdent("baseline");

    private static String[] values = {
	"baseline", "use-script", "before-edge",
	"text-before-edge", "after-edge", "text-after-edge", "central",
	"middle", "ideographic", "alphabetic", "hanging", "mathematical",
	"inherit", "initial"
    };
    
    /**
     * Create a new CssAlignmentBaseLine
     */
    public CssAlignmentBaseLine() {
	albaseline = baseline;
    }
    
    /**
     * Create a new CssAlignmentBaseLine
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssAlignmentBaseLine(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	setByUser();
	CssValue val = expression.getValue();
	
	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		albaseline = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssAlignmentBaseLine(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssAlignmentBaseLine != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssAlignmentBaseLine = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getAlignmentBaseLine();
	}
	else {
	    return ((Css3Style) style).cssAlignmentBaseLine;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssAlignmentBaseLine &&
		albaseline.equals(((CssAlignmentBaseLine) property).albaseline));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "alignment-baseline";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return albaseline;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return albaseline.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return albaseline.toString();
    }
    
    /**
     * 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 (albaseline == baseline);
    }
    
}

--- NEW FILE: CssTextOLColor.java ---
//
// $Id: CssTextOLColor.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM>  auto || &lt;color&gt; || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies the color for the overline.
 */

public class CssTextOLColor extends CssProperty {
 
    CssValue olcolor;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssTextOLColor
     */
    public CssTextOLColor() {
	olcolor = auto;
    }

    /**
     * Create a new CssTextOLColor
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextOLColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val instanceof org.w3c.css.values.CssColor) {
	    olcolor = val;
	    expression.next();
	}
        else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		olcolor = inherit;
		expression.next();
	    }
	    else if (val.equals(auto)) {
		olcolor = auto;
		expression.next();
	    }
	    else {
		olcolor = new org.w3c.css.values.CssColor(ac, (String) val.get());
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", 
					    expression.getValue(), 
					    getPropertyName(), ac);
	}
    }

    public CssTextOLColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextOLColor != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextOLColor = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextOLColor();
	}
	else {
	    return ((Css3Style) style).cssTextOLColor;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextOLColor &&
		olcolor.equals(((CssTextOLColor) property).olcolor));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-overline-color";
    }

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

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

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

    /**
     * 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 olcolor == auto;
    }

}

--- NEW FILE: CssBorderRightImage.java ---
//
// $Id: CssBorderRightImage.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;



public class CssBorderRightImage extends CssProperty {
    
    String value;
    ApplContext ac;
    CssIdent none = new CssIdent("none");
    
    /**
     * Create new CssBorderRightImage
     */
    public CssBorderRightImage() {
	value = "none";
    }
    
    /**
     * Create new CssBorderRightImage
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderRightImage(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssIdent) {
	    if (val.equals(none)) {
		value = "none";
		expression.next();
	    } else if (val.equals(inherit)) {
		value = "inherit";
		expression.next();
	    }
	} else if (val instanceof CssURL) {
	    
	    value = val.toString();
	    expression.next();
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		if (val instanceof CssURL) {
		    value += " " + val.toString();
		    expression.next();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
		
		expression.next();
		val = expression.getValue();
		
		if (val != null) {
		    if (val instanceof CssURL) {
			value += " " + val.toString();
			expression.next();
		    } else {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		}
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBorderRightImage(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderRightImage != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderRightImage = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderRightImage();
	} else {
	    return ((Css3Style) style).cssBorderRightImage;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderRightImage &&
		value.equals( ((CssBorderRightImage) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-right-image";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: CssIndentEdgeReset.java ---
//
// $Id: CssIndentEdgeReset.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

public class CssIndentEdgeReset extends CssProperty {

    CssValue value;

    static CssIdent none = new CssIdent("none");

    private static String[] values = {
		"none", "margin-edge", "border-edge", "padding-edge", "content-edge", "initial", "inherit"
    };

    /**
     * Create a new CssIndentEdgeReset
     */
    public CssIndentEdgeReset() {
		value = none;
    }

    /**
     * Create a new CssIndentEdgeReset
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssIndentEdgeReset(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		value = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssIndentEdgeReset(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssIndentEdgeReset != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssIndentEdgeReset = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getIndentEdgeReset();
	}
	else {
	    return ((Css3Style) style).cssIndentEdgeReset;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
		return "float-displace";
    }

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

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

    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
		return (value == none);
    }

}

--- NEW FILE: CssColumnWidth.java ---
//
// $Id: CssColumnWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;integer&gt; || auto || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'column-width' property describes the optimal width of columns within the element. 
 *  Depending on the value of 'column-width-policy', the actual column width may be 
 *  larger than the specified one. 
 */

public class CssColumnWidth extends CssProperty {

    CssValue width;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssColumnWidth
     */
    public CssColumnWidth() {
	// nothing to do
    }

    /**
     * Create a new CssColumnWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssColumnWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    width = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    width = val;
	    expression.next();
	} else if (val instanceof CssNumber) {
	    width = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssColumnWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssColumnWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssColumnWidth = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getColumnWidth();
	}
	else {
	    return ((Css3Style) style).cssColumnWidth;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssColumnWidth &&
		width.equals(((CssColumnWidth) property).width));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "column-width";
    }

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

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

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

    /**
     * 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 (width == auto);
    }

}

--- NEW FILE: CssDropInitialBeforeAlign.java ---
//
// $Id: CssDropInitialBeforeAlign.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> baseline || auto-script || before-edge ||
 *  text-before-edge || after-edge || text-after-edge || middle ||
 *  ideographic || lower || hanging || mathematical || inherit<BR>
 *  <EM>Initial:</EM>baseline<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies how an inline-level element is aligned with
 *   respect to its parent.
 */

public class CssDropInitialBeforeAlign extends CssProperty {

    CssValue dropvalue;

    static CssIdent capsheight = new CssIdent("caps-height");

    private static String[] values = {
	"caps-height", "baseline", "use-script", "before-edge",
	"text-before-edge", "after-edge", "text-after-edge", "central", "middle",
	"ideographic", "alphabetic", "hanging", "mathematical", "inherit", "initial"
    };

    /**
     * Create a new CssDropInitialBeforeAlign
     */
    public CssDropInitialBeforeAlign() {
		dropvalue = capsheight;
    }

    /**
     * Create a new CssDropInitialBeforeAlign
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssDropInitialBeforeAlign(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		dropvalue = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssDropInitialBeforeAlign(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssDropInitialBeforeAlign != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssDropInitialBeforeAlign = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getDropInitialBeforeAlign();
	}
	else {
	    return ((Css3Style) style).cssDropInitialBeforeAlign;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "drop-initial-before-align";
    }

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

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

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

    /**
     * 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 (dropvalue == capsheight);
    }

}

--- NEW FILE: CssTextOverflowMode.java ---
//
// $Id: CssTextOverflowMode.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */

    public class CssTextOverflowMode extends CssProperty {

	CssValue overflowmode;

	private static CssIdent clip = new CssIdent("clip");
	private static CssIdent ellipsis = new CssIdent("ellipsis");
	private static CssIdent ellipsisword = new CssIdent("ellipsis-word");

	/**
	 * Create a new CssTextOverflowMode
	 */
	public CssTextOverflowMode() {
	    overflowmode = clip;
	}

	/**
	 * Create a new CssTextOverflowMode
	 *
	 *
	 */
	public CssTextOverflowMode(ApplContext ac, CssExpression expression,
		boolean check) throws InvalidParamException {
	    setByUser();
	    CssValue val = expression.getValue();
	    if (val.equals(clip)) {
			overflowmode = clip;
			expression.next();
	    }
	    else if (val.equals(ellipsis)) {
			overflowmode = ellipsis;
			expression.next();
	    }
	    else if (val.equals(ellipsisword)) {
			overflowmode = ellipsisword;
			expression.next();
	    }
	    else if (val.equals(inherit)) {
			overflowmode = inherit;
			expression.next();
	    }

	    else {
		throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	    }
	}

	public CssTextOverflowMode(ApplContext ac, CssExpression expression)
		throws InvalidParamException {
	    this(ac, expression, false);
	}
	
	/**
	 * Add this property to the CssStyle.
	 *
	 * @param style The CssStyle
	 */
	public void addToStyle(ApplContext ac, CssStyle style) {
	    if (((Css3Style) style).cssTextOverflowMode != null)
		style.addRedefinitionWarning(ac, this);
	    ((Css3Style) style).cssTextOverflowMode = this;

	}

	/**
	 * Get this property in the style.
	 *
	 * @param style The style where the property is
	 * @param resolve if true, resolve the style to find this property
	 */
        public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	    if (resolve) {
		return ((Css3Style) style).getTextOverflowMode();
	    } else {
		return ((Css3Style) style).cssTextOverflowMode;
	    }
	}

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

	/**
	 * Returns the name of this property
	 */
	public String getPropertyName() {
	    return "text-overflow-mode";
	}

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

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

	/**
	 * Returns a string representation of the object
	 */
	public String toString() {
	    return overflowmode.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 overflowmode == clip;
	}

    }

--- NEW FILE: MediaMaxDeviceWidth.java ---
//
// $Id: MediaMaxDeviceWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMaxDeviceWidth.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:04:22  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMaxDeviceWidth extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMaxDeviceWidth
     */
    public MediaMaxDeviceWidth() {
	//empty
    }
    
    /**
     * Create a new MediaMaxDeviceWidth.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMaxDeviceWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaMaxDeviceWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "max-device-width";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMaxDeviceWidth != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMaxDeviceWidth = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMaxDeviceWidth();
	} else {
	    return ((Css3Style) style).mediaMaxDeviceWidth;
	}
    }

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

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

}

--- NEW FILE: CssWhiteSpaceCSS3.java ---
//
// $Id: CssWhiteSpaceCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssWhiteSpaceCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.3  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/12/23 08:19:46  sijtsche
 * values changed
 *
 * Revision 1.1  2002/08/09 11:41:57  sijtsche
 * new value for CSS3 white-space property
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:38  plehegar
 * Nothing
 *
 * Revision 1.3  1997/08/06 17:30:24  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/25 14:30:25  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *   <H4>
 *      &nbsp;&nbsp; 'white-space'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> normal | pre | nowrap<BR>
 *   <EM>Initial:</EM> normal<BR>
 *   <EM>Applies to:</EM> block-level elements<BR>
 *   <EM>Inherited:</EM> yes<BR>
 *   <EM>Percentage values:</EM> N/A<BR>
 *
 *   <P> This property declares how whitespace inside the element is handled:
 *   the 'normal' way (where whitespace is collapsed), as 'pre' (which behaves
 *   like the 'PRE' element in HTML) or as 'nowrap' (where wrapping is done only
 *   through BR elements):
 *
 *   <PRE>
 *   PRE { white-space: pre }
 *   P   { white-space: normal }
 * </PRE>
 *
 *   <P> The initial value of 'white-space' is 'normal', but a UA will typically
 *   have default values for all HTML elements according to the suggested
 *   rendering of elements in the HTML specification.
 *
 * @version $Revision: 1.1 $
 */
public class CssWhiteSpaceCSS3 extends CssProperty {

    int value;

    private static String[] WHITESPACE = {
	"normal", "pre", "nowrap", "pre-wrap", "pre-lines", "inherit" };
    private static int[] hash_values;

    /**
     * Create a new CssWhiteSpace
     */
    public CssWhiteSpaceCSS3() {
	// nothing to do
    }

    /**
     * Create a new CssWhiteSpace
     *
     * @param expression The expression for this property
     * @exception InvalidParamException values are incorrect
     */
    public CssWhiteSpaceCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();

	if ( val instanceof CssIdent) {
	    int hash = val.hashCode();
	    for (int i = 0; i < WHITESPACE.length; i++)
		if (hash_values[i] == hash) {
		    value = i;
		    expression.next();
		    return;
		}
	}

	throw new InvalidParamException("value", expression.getValue(),
					getPropertyName(), ac);
    }

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

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "white-space";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return value == (WHITESPACE.length - 1);
    }

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

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssWhiteSpace != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssWhiteSpace = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getWhiteSpace();
	} else {
	    return ((Css3Style) style).cssWhiteSpace;
	}
    }

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

    static {
	hash_values = new int[WHITESPACE.length];
	for (int i = 0; i < WHITESPACE.length; i++)
	    hash_values[i] = WHITESPACE[i].hashCode();
    }
}

--- NEW FILE: CssTextPropertiesConstantsCSS3.java ---
//
// $Id: CssTextPropertiesConstantsCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssTextPropertiesConstantsCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2002/12/23 08:24:07  sijtsche
 * text-decoration values changed
 *
 * Revision 1.1  2002/08/07 14:21:31  sijtsche
 * lining values added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 1.2  1997/07/30 13:20:21  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/24 01:39:42  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

/**
 * @version $Revision: 1.1 $
 */
public interface CssTextPropertiesConstantsCSS3 {
  public static String[] TEXTDECORATION = {
    "none", "underline", "overline", "line-through", "blink", "inherit" };

  public static String[] TEXTDECORATIONMOB = {
    "underline", "inherit" };

  public static String[] VERTICALALIGN = {
    "baseline", "sub", "super", "top", "text-top", "middle",
    "bottom", "text-bottom", "inherit" };

  public static String[] VERTICALALIGNMOB = {
    "baseline", "sub", "super", "inherit" };

  public static String[] TEXTTRANSFORM = {
    "none", "capitalize", "uppercase", "lowercase", "inherit" };

  public static String[] TEXTALIGN = {
    "left", "right", "center", "justify", "inherit", "start", "end" };

}

--- NEW FILE: CssPaddingBottomCSS3.java ---
//
// $Id: CssPaddingBottomCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssPaddingBottomCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/12/24 13:20:53  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:13:58  plehegar
 * Freeze
 *
 * Revision 1.4  1997/08/20 11:41:27  plehegar
 * Freeze
 *
 * Revision 1.3  1997/08/06 17:30:14  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:20:14  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/24 01:30:58  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'padding-bottom'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> &lt;length&gt; | &lt;percentage&gt;<BR>
 *   <EM>Initial:</EM> 0<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> refer to parent element's width<BR>
 *   <P>
 *   This property sets the bottom padding of an element.
 *   <PRE>
 *   BLOCKQUOTE { padding-bottom: 2em }
 * </PRE>
 *   <P>
 *   Padding values cannot be negative.
 * @version $Revision: 1.1 $
 */
public class CssPaddingBottomCSS3 extends CssPaddingSideCSS3 {
    
    /**
     * Create a new CssPaddingBottomCSS3
     */
    public CssPaddingBottomCSS3() {
	super();
    }
    
    /**
     * Create a new CssPaddingBottomCSS3 with an another CssPaddingSideCSS3
     *
     * @param another The another side.
     */
    public CssPaddingBottomCSS3(CssPaddingSideCSS3 another) {
	super(another);
    }
    
    /**
     * Create a new CssPaddingBottomCSS3
     *
     * @param expression The expression for this property.
     * @exception InvalidParamException Values are incorrect
     */
    public CssPaddingBottomCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	super(ac, expression, check);
    }
    
    public CssPaddingBottomCSS3(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "padding-bottom";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssPaddingBottomCSS3 != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssPaddingBottomCSS3 = this;
	
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getPaddingBottomCSS3();
	} else {
	    return ((Css3Style) style).cssPaddingCSS3.getBottom();
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssPaddingBottomCSS3 && 
		value.equals(((CssPaddingBottomCSS3) property).value));
    }
    
}

--- NEW FILE: MediaMaxDeviceHeight.java ---
//
// $Id: MediaMaxDeviceHeight.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMaxDeviceHeight.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:04:22  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMaxDeviceHeight extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMaxDeviceHeight
     */
    public MediaMaxDeviceHeight() {
		//empty
    }

    /**
     * Create a new MediaMaxDeviceHeight.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMaxDeviceHeight(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaMaxDeviceHeight(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "max-device-height";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMaxDeviceHeight != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMaxDeviceHeight = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMaxDeviceHeight();
	} else {
	    return ((Css3Style) style).mediaMaxDeviceHeight;
	}
    }

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

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

}

--- NEW FILE: CssBorderBottomLeftRadius.java ---
//
// $Id: CssBorderBottomLeftRadius.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssValue;

public class CssBorderBottomLeftRadius extends CssProperty {

    String value;
    ApplContext ac;
    
    /**
     * Create new CssBorderBottomLeftRadius
     */
    public CssBorderBottomLeftRadius() {
	CssNumber cssnum =  new CssNumber((float) 1.0);
	value = cssnum.toString();
    }
    
    /**
     * Create new CssBorderBottomLeftRadius
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderBottomLeftRadius(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssLength) {
	    value = val.toString();
	    expression.next();
	    
	    val = expression.getValue();
	    if (val != null) {
		
		if (val instanceof CssLength) {
		    value += " " + val.toString();
		    expression.next();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBorderBottomLeftRadius(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomLeftRadius != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomLeftRadius = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomLeftRadius();
	} else {
	    return ((Css3Style) style).cssBorderBottomLeftRadius;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomLeftRadius &&
		value.equals( ((CssBorderBottomLeftRadius) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-left-radius";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: CssRubyAlign.java ---
//
// $Id: CssRubyAlign.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || start || left || center || end|| right || distribute-letter ||
 *  distribute-space || line-edge || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elementes<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property can be used on any element to control the text alignment of
 *  the ruby text and ruby base contents relative to each other. It applies to
 *  all the ruby's in the element.
 *  For simple ruby, the alignment is applied to the ruby child element whose
 *  content is shorter: either the rb element or the rt element [RUBY]. For
 *  group ruby, the alignment is also applied to the ruby child elements
 *  whose content is shorter: either the rb element and/or one or two rt
 *  elements for each related ruby text and ruby base element within the
 *  rtc and rbc element.
*/

public class CssRubyAlign extends CssProperty {

    CssValue rubyalign;
    ApplContext ac;

    CssIdent auto = new CssIdent("auto");
    CssIdent start = new CssIdent("start");
    CssIdent left = new CssIdent("left");
    CssIdent center = new CssIdent("center");
    CssIdent end = new CssIdent("end");
    CssIdent right = new CssIdent("right");
    CssIdent distributeletter = new CssIdent("distribute-letter");
    CssIdent distributespace = new CssIdent("distribute-space");
    CssIdent lineedge = new CssIdent("line-edge");

    /**
     * Create a new CssRubyAlign
     */
    public CssRubyAlign() {
	rubyalign = auto;
    }

    /**
     * Create a new CssRubyAlign
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssRubyAlign(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(auto)) {
	    rubyalign = auto;
	    expression.next();
	}
	else if (val.equals(left)) {
	    rubyalign = left;
	    expression.next();
	}
	else if (val.equals(center)) {
	    rubyalign = center;
	    expression.next();
	}
	else if (val.equals(right)) {
	    rubyalign = right;
	    expression.next();
	}
	else if (val.equals(distributeletter)) {
	    rubyalign = distributeletter;
	    expression.next();
	}
	else if (val.equals(distributespace)) {
	    rubyalign = distributespace;
	    expression.next();
	}
	else if (val.equals(lineedge)) {
	    rubyalign = lineedge;
	    expression.next();
	}
	else if (val.equals(start)) {
	    rubyalign = start;
	    expression.next();
	}
	else if (val.equals(end)) {
	    rubyalign = end;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

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

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssRubyAlign != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssRubyAlign = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getRubyAlign();
	} else {
	    return ((Css3Style) style).cssRubyAlign;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "ruby-align";
    }

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

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return rubyalign.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 rubyalign == auto;
    }

}

--- NEW FILE: CssFloatCSS3.java ---
//
// $Id: CssFloatCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssFloatCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.3  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.2  2002/12/24 13:44:39  sijtsche
 * values changed
 *
 * Revision 1.1  2002/07/19 20:30:12  sijtsche
 * files representing CSS3 properties
 *
 * Revision 1.1  2002/05/08 09:30:52  dejong
 * CSS version 3 specific properties as in March 2002, all modules
 *
 * Revision 3.1  1997/08/29 13:13:44  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:21  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:15  plehegar
 * Nothing
 *
 * Revision 1.3  1997/08/06 17:30:00  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:19:56  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/25 14:30:42  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *   <H4>
 *      &nbsp;&nbsp; 'float'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> left | right | none<BR>
 *   <EM>Initial:</EM> none<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> N/A<BR>

 *   <P> With the value 'none', the element will be displayed where it appears
 *   in the text. With a value of 'left' ('right') the element will be moved to
 *   the left ('right') and the text will wrap on the right (left) side of the
 *   element.  With a value of 'left' or 'right', the element is treated as
 *   block-level (i.e. the 'display' property is ignored).
 *
 *   <H3>
 *      &nbsp;&nbsp; Floating elements
 *   </H3>

 *   <P> Using the <A HREF="#float">'float'</A> property, an element can be
 *   declared to be outside the normal flow of elements and is then formatted as
 *   a block-level element. For example, by setting the 'float' property of an
 *   image to 'left', the image is moved to the left until the margin, padding
 *   or border of another block-level element is reached. The normal flow will
 *   wrap around on the right side. The margins, borders and padding of the
 *   element itself will be honored, and the margins never collapse with the
 *   margins of adjacent elements.

 *   <P> A floating element is positioned subject to the following constraints:

 *   <OL>

 *     <LI> The left outer edge of a left-floating element may not be to the
 *     left of the left inner edge of its parent element. Analogously for right
 *     floating elements.

 *     <LI> The left outer edge of a left floating element must be to the right
 *     of the right outer edge of every earlier (in the HTML source)
 *     left-floating element or the top of the former must be lower than the
 *     bottom of the latter. Analogously for right floating elements.

 *     <LI> The right outer edge of a left-floating element may not be to the
 *     right of the left outer edge of any right-floating element that is to the
 *     right of it. Analogously for right-floating elements.

 *     <LI> A floating element's top may not be higher than the inner top of its
 *     parent.

 *     <LI> A floating element's top may not be higher than the top of any
 *     earlier floating or block-level element.

 *     <LI> A floating element's top may not be higher than the top of any
 *     <EM>line-box</EM> (see section 4.4) with content that precedes the
 *     floating element in the HTML source.

 *     <LI> A floating element must be placed as high as possible.

 *     <LI> A left-floating element must be put as far to the left as possible,
 *     a right-floating element as far to the right as possible. A higher
 *     position is preferred over one that is further to the left/right.

 *   </OL>
 *   <PRE>
 *   &lt;STYLE TYPE="text/css"&gt;
 *     IMG { float: left }
 *     BODY, P, IMG { margin: 2em }
 *   &lt;/STYLE&gt;

 *   &lt;BODY&gt;
 *     &lt;P&gt;
 *       &lt;IMG SRC=img.gif&gt;
 *       Some sample text that has no other...
 *   &lt;/BODY&gt;
 * </PRE>
 *   <P>
 *   The above example could be formatted as:
 *   <PRE>
 *    ________________________________________
 *   |
 *   |          max(BODY margin, P margin)
 *   |          ______________________________
 *   |    |    |             Some sample text
 *   | B  | P  | IMG margins that has no other
 *   | O  |    |    _____    purpose than to
 *   | D  | m  |   |     |   show how floating
 *   | Y  | a  |   | IMG |   elements are moved
 *   |    | r  |   |     |   to the side of the
 *   | m  | g  |   |_____|   parent element
 *   | a  | i  |             while honoring
 *   | r  | n  |             margins, borders
 *   | g  |    |             and padding. Note
 *   | i  |    |how adjacent vertical margins
 *   | n  |    |are collapsed between non-
 *   |    |    |floating block-level elements.
 * </PRE>
 *   <P> Note that the margin of the 'P' elements enclose the floating 'IMG'
 *   element.
 *   <P> There are two situations when floating elements can overlap with the
 *   margin, border and padding areas of other elements:
 *   <UL>
 *     <LI> when the floating element has a negative margin: negative margins on
 *     floating elements are honored as on other block-level elements.
 *     <LI> when the floating element is wider or higher than the element it is
 *     inside
 *   </UL>
 *
 * @version $Revision: 1.1 $
 */
public class CssFloatCSS3 extends CssProperty {

    int value;

    private static String[] FLOAT = {
	"left", "right", "top", "bottom", "inside", "outside", "start",
	"end", "none", "inherit", "initial"
    };

    private static int[] hash_values;

    /**
     * Create a new CssFloatCSS3
     */
    public CssFloatCSS3() {
	// nothing to do
    }

    /**
     * Create a new CssFloatCSS3
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssFloatCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();
	setByUser();
	if ( val instanceof CssIdent) {
	    int hash = val.hashCode();
	    for (int i = 0; i < FLOAT.length; i++)
		if (hash_values[i] == hash) {
		    value = i;
		    expression.next();
		    return;
		}
	}
	throw new InvalidParamException("value", expression.getValue(),
					getPropertyName(), ac);
    }

    public CssFloatCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return FLOAT[value];
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "float";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return value == FLOAT.length - 1;
    }

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

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssFloatCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssFloatCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getFloatCSS3();
	} else {
	    return ((Css3Style) style).cssFloatCSS3;
	}
    }

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

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

    static {
	hash_values = new int[FLOAT.length];
	for (int i = 0; i < FLOAT.length; i++)
	    hash_values[i] = FLOAT[i].hashCode();
    }
}

--- NEW FILE: CssMaxFontSize.java ---
//
// $Id: CssMaxFontSize.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.properties.css2.font.FontSize;
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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;font-size&gt; || auto || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>element's computed 'font-size'<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  If 'text-align-last' is 'size', the fonts of the last line of an element are not allowed to become larger than the larger of 'font-size' and 'max-font-size'. 'auto' means that there is no limit.
*/

public class CssMaxFontSize extends CssProperty {

    CssValue max;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssMaxFontSize
     */
    public CssMaxFontSize() {
	max = auto;
    }

    /**
     * Create a new CssMaxFontSize
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssMaxFontSize(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(auto)) {
	    max = auto;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    max = inherit;
	    expression.next();
	}
	else {
	    try {
		FontSize fontsize = new FontSize(ac, expression); 
		max = val;
		expression.next();
	    }
	    catch (InvalidParamException e) {
		throw new InvalidParamException("value", expression.getValue(),
						getPropertyName(), ac);
	    }
	}
    }

    public CssMaxFontSize(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssMaxFontSize != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssMaxFontSize = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMaxFontSize();
	} else {
	    return ((Css3Style) style).cssMaxFontSize;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssMaxFontSize && 
                max.equals( ((CssMaxFontSize) property).max));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "max-font-size";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return max;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return max.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return max.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 max == auto;
    }
    
}

--- NEW FILE: CssColumnRuleColor.java ---
//
// $Id: CssColumnRuleColor.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssColor;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;color&gt; || inherit<BR>
 *  <EM>Initial:</EM>the value of the color property<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property describes how to interpret 'column-width'. The 'flexible'
 *  value indicates that the width of columns can be increased to fill all
 *  the available space. The 'strict' value indicates that 'column-width' is
 *  to be honored.
 */

public class CssColumnRuleColor extends CssProperty {

    CssColor color;

    /**
     * Create a new CssColumnRuleColor
     */
    public CssColumnRuleColor() {
	// nothing to do
    }

    /**
     * Create a new CssColumnRuleColor
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssColumnRuleColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	try {
	    color = new CssColor(ac, expression);
	    expression.next();
	}
	catch (InvalidParamException e) {
	    throw new InvalidParamException("value",
					    expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssColumnRuleColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssColumnRuleColor != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssColumnRuleColor = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getColumnRuleColor();
	}
	else {
	    return ((Css3Style) style).cssColumnRuleColor;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "column-border-color";
    }

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

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

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

    /**
     * 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 false;
    }

}

--- NEW FILE: CssTextDecorationCSS3.java ---
//
// $Id: CssTextDecorationCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssTextDecorationCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/08/07 14:22:12  sijtsche
 * separate version for CSS3: lining values added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:05  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:29  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:35  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:21  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:19  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/23 23:38:44  plehegar
 * bug fix none
 *
 * Revision 1.1  1997/07/23 22:11:30  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'text-decoration'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> none | [ underline || overline || line-through || blink ]<BR>
 *   <EM>Initial:</EM> none<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no, but see clarification below<BR>
 *   <EM>Percentage values:</EM> N/A<BR>
 *   <P>
 *   This property describes decorations that are added to the text of an element.
 *   If the element has no text (e.g. the 'IMG' element in HTML) or is an empty
 *   element (e.g. '&lt;EM&gt;&lt;/EM&gt;'), this property has no effect. A value
 *   of 'blink' causes the text to blink.
 *   <P>
 *   The color(s) required for the text decoration should be derived from the
 *   'color' property value.
 *   <P>
 *   This property is not inherited, but elements should match their parent. E.g.,
 *   if an element is underlined, the line should span the child elements. The
 *   color of the underlining will remain the same even if descendant elements
 *   have different 'color' values.
 *   <PRE>
 *   A:link, A:visited, A:active { text-decoration: underline }
 * </PRE>
 *   <P>
 *   The example above would underline the text of all links (i.e., all 'A' elements
 *   with a 'HREF' attribute).
 *   <P>
 *   UAs must recognize the keyword 'blink', but are not required to support the
 *   blink effect.
 *
 * @version $Revision: 1.1 $
 */
public class CssTextDecorationCSS3 extends CssProperty
        implements CssTextPropertiesConstantsCSS3 {

    CssValue value;

    private boolean[] values = new boolean[TEXTDECORATION.length];

    private static int[] hash_values;

    private static CssIdent none = new CssIdent("none");

    private static final int INVALID = -1;

    /**
     * Create a new CssTextDecoration
     */
    public CssTextDecorationCSS3() {
    }

    /**
     * Create a new CssTextDecoration
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssTextDecorationCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();
	boolean find = true;
	int computed = 0;
	int index = INVALID;

	setByUser();

	if (val.equals(none)) {
	    value = none;
	    expression.next();
	    return;
	} else if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    return;
	}
	val = null;
	
	while (find) {
	    find = false;
	    val = expression.getValue();
	    if (val instanceof CssIdent) {
		index = getIndex((CssIdent) val, ac);
		if (values[index] == true) {
		    throw new InvalidParamException("same-value",
			    TEXTDECORATION[index], ac);
		} else {
		    values[index] = true;
		    find = true;
		    expression.next();
		}
	    } else if (val != null) {
		throw new InvalidParamException("value", val.toString(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssTextDecorationCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (value != null) {
	    return value;
	}
	for (int i = 0; i < TEXTDECORATION.length; i++) {
	    if (values[i] == true) {
		return TEXTDECORATION[i];
	    }
	}
	return null;
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-decoration";
    }

    private int getIndex(CssIdent val, ApplContext ac) throws InvalidParamException {
	int hash = val.hashCode();
	for (int i = 0; i < TEXTDECORATION.length; i++) {
	    if (hash_values[i] == hash) {
		return i;
	    }
	}
	throw new InvalidParamException("value", val.toString(),
					getPropertyName(), ac);
    }

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

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (value != null) {
	    return value.toString();
	} else {
	    String ret = "";
	    for (int i = 0; i < TEXTDECORATION.length; i++) {
		if (values[i] == true) {
		    ret += " " + TEXTDECORATION[i];
		}
	    }
	    return ret.substring(1);
	}
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssTextDecoration != null) {
	    style0.addRedefinitionWarning(ac, this);
	}
	style0.cssTextDecoration = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextDecoration();
	} else {
	    return ((Css3Style) style).cssTextDecoration;
	}
    }

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

    static {
	hash_values = new int[TEXTDECORATION.length];
	for (int i=0; i<TEXTDECORATION.length; i++) {
	    hash_values[i] = TEXTDECORATION[i].hashCode();
	}
    }
}

--- NEW FILE: MediaMaxDeviceAspectRatio.java ---
//
// $Id: MediaMaxDeviceAspectRatio.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMaxDeviceAspectRatio.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:04:22  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMaxDeviceAspectRatio extends CssProperty implements CssOperator {

    String value = "";

    /**
     * Create a new MediaMaxDeviceAspectRatio
     */
    public MediaMaxDeviceAspectRatio() {
		//empty
    }

    /**
     * Create a new MediaMaxDeviceAspectRatio.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMaxDeviceAspectRatio(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	char op = SPACE;
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val.toString();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    op = expression.getOperator();
	    expression.next();
	    val = expression.getValue();
	    
	    if (op == SLASH && val != null) {
		
		if (val instanceof CssNumber) {
		    if (((CssNumber) val).isInteger()) {
			value += "/" + val.toString();
		    } else {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
		
		
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	    
	}
    }

    public MediaMaxDeviceAspectRatio(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-device-aspect-ratio";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
		return false;
    }

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMaxDeviceAspectRatio != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMaxDeviceAspectRatio = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMaxDeviceAspectRatio();
	} else {
	    return ((Css3Style) style).mediaMaxDeviceAspectRatio;
	}
    }

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

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

}

--- NEW FILE: CssTextAlignLast.java ---
//
// $Id: CssTextAlignLast.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || start || end || center || justify ||
 *  size || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property describes how the last line of the inline content of a block
 *  is aligned. This also applies to the only line of a block if it contains a
 *  single line, the line preceding a BR element and to last lines of
 *  anonymous blocks. Typically the last line is aligned like the other lines
 *  of the block element, this is set by the 'text-align' property. However,
 *  in some situations like when the 'text-align' property is set to
 *  'justify', the last line may be aligned differently.
 */

public class CssTextAlignLast extends CssProperty {

    CssValue alignlast;

    static CssIdent start = new CssIdent("start");
    static CssIdent end = new CssIdent("end");
    static CssIdent center = new CssIdent ("center");
    static CssIdent justify = new CssIdent("justify");
    static CssIdent size = new CssIdent("size");
	static CssIdent left = new CssIdent("left");
	static CssIdent right = new CssIdent("right");

    /**
     * Create a new CssTextAlignLast
     */
    public CssTextAlignLast() {
		alignlast = start;
    }

    /**
     * Create a new CssTextAlignLast
     *
     * @param expression The expression for this parameter
     * @exception InvalidParamException Incorrect value
     */
    public CssTextAlignLast(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(start)) {
	    alignlast = start;
	    expression.next();
	}
	else if (val.equals(end)) {
	    alignlast = end;
	    expression.next();
	}
	else if (val.equals(center)) {
	    alignlast = center;
	    expression.next();
	}
	else if (val.equals(justify)) {
	    alignlast = justify;
	    expression.next();
	}
	else if (val.equals(size)) {
	    alignlast = size;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    alignlast = inherit;
	    expression.next();
	}
	else if (val.equals(left)) {
		alignlast = left;
	}
	else if (val.equals(right)) {
		alignlast = right;
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextAlignLast(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextAlignLast != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextAlignLast = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextAlignLast();
	}
	else {
	    return ((Css3Style) style).cssTextAlignLast;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-align-last";
    }

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

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

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

    /**
     * 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 alignlast == start;
    }

}




--- NEW FILE: MediaGrid.java ---
//
// $Id: MediaGrid.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaGrid.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:05:40  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaGrid extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaGrid
     */
    public MediaGrid() {
		//empty
    }

    /**
     * Create a new MediaGrid.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaGrid(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaGrid(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "grid";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaGrid != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaGrid = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaGrid();
	} else {
	    return ((Css3Style) style).mediaGrid;
	}
    }

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

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

}

--- NEW FILE: CssBorderRadius.java ---
//
// $Id: CssBorderRadius.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssValue;



public class CssBorderRadius extends CssProperty {

    String value;
    ApplContext ac;
    
    /**
     * Create new CssBorderRadius
     */
    public CssBorderRadius() {
	CssNumber cssnum =  new CssNumber((float) 1.0);
	value = cssnum.toString();
    }
    
    /**
     * Create new CssBorderRadius
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderRadius(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssLength) {
	    value = val.toString();
	    expression.next();
	    
	    val = expression.getValue();
	    if (val != null) {
		
		if (val instanceof CssLength) {
		    value += " " + val.toString();
		    expression.next();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBorderRadius(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }    
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderRadius != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderRadius = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderRadius();
	} else {
	    return ((Css3Style) style).cssBorderRadius;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderRadius &&
		value.equals( ((CssBorderRadius) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-radius";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }

}

--- NEW FILE: CssBorderRightFitLength.java ---
//
// $Id: CssBorderRightFitLength.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderRightFitLength extends CssProperty {

    String value = "";

    CssIdent repeat = new CssIdent("repeat");

    private static String[] values = {
		"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };

    /**
     * Create a new CssBorderRightFitLength
     */
    public CssBorderRightFitLength() {
		value = "repeat";
    }

    /**
     * Create a new CssBorderRightFitLength
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderRightFitLength(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderRightFitLength(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderRightFitLength != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderRightFitLength = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderRightFitLength();
	}
	else {
	    return ((Css3Style) style).cssBorderRightFitLength;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderRightFitLength &&
		value.equals(((CssBorderRightFitLength) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-right-fit-length";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }

}

--- NEW FILE: CssBorderFitWidth.java ---
//
// $Id: CssBorderFitWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderFitWidth extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderFitWidth
     */
    public CssBorderFitWidth() {
	value = "repeat";
    }
    
    /**
     * Create a new CssBorderFitWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderFitWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (expression.getCount() <= 4) {
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		
		for (; i < expression.getCount(); i++) {
		    
		    int j = 0;
		    for (; j < values.length; j++) {
			if (val.toString().equals(values[j])) {
			    value += val.toString() + " ";
			    expression.next();
			    break;
			}
		    }
		    
		    if (j == values.length) {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		}
	    }
	    
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
    }
    
    public CssBorderFitWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderFitWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderFitWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderFitWidth();
	}
	else {
	    return ((Css3Style) style).cssBorderFitWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderFitWidth &&
		value.equals(((CssBorderFitWidth) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-fit-width";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }
    
}

--- NEW FILE: MediaMaxColor.java ---
//
// $Id: MediaMaxColor.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMaxColor.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:05:40  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMaxColor extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMaxColor
     */
    public MediaMaxColor() {
	//empty
    }

    /**
     * Create a new MediaMaxColor.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMaxColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaMaxColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "max-color";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMaxColor != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMaxColor = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMaxColor();
	} else {
	    return ((Css3Style) style).mediaMaxColor;
	}
    }

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

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

}

--- NEW FILE: CssFontSmooth.java ---
//
// $Id: CssFontSmooth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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 java.util.Hashtable;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || never || always || &lt;font-size&gt; || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property allows author control over applying anti-aliasing fonts when rendered.
 *  <PRE>
 *  H1 { font-smooth: never}
 *  </PRE>
 */

public class CssFontSmooth extends CssProperty {

    CssValue fontsmooth;
    ApplContext ac;

    static CssIdent auto = new CssIdent("auto");
    static CssIdent never = new CssIdent("never");
    static CssIdent always = new CssIdent("always");
    static CssIdent xxsmall = new CssIdent("xx-small");
    static CssIdent xsmall = new CssIdent("x-small");
    static CssIdent small = new CssIdent("small");
    static CssIdent medium = new CssIdent("medium");
    static CssIdent large = new CssIdent("large");
    static CssIdent xlarge = new CssIdent("x-large");
    static CssIdent xxlarge = new CssIdent("xx-large");

    Hashtable fsizes = new Hashtable();

    /**
     * Create a new CssFontSmooth
     */
    public CssFontSmooth() {
	fontsmooth = auto;
    }

    /**
     * Create a new CssFontSmooth
     *
     * @param  expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssFontSmooth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	fsizes.put(xxsmall, "nothing");
	fsizes.put(xsmall, "nothing");
	fsizes.put(small, "nothing");
	fsizes.put(medium, "nothing");
	fsizes.put(large, "nothing");
	fsizes.put(xlarge, "nothing");
	fsizes.put(xxlarge, "nothing");
	CssValue val = expression.getValue();

	if (fsizes.containsKey(val)) {
	    fontsmooth = val;
	    expression.next();
	}
	else if (val instanceof CssLength) { // may not be negative!
	    float f = ((Float) val.get()).floatValue();
	    if (f >= 0) {
		fontsmooth = val;
		expression.next();
		return;
	    }
	    else {
		throw new InvalidParamException("negative-value",
						val.toString(), ac);
	    }
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(auto)) {
		fontsmooth = auto;
		expression.next();
	    }
	    else if (val.equals(never)) {
		fontsmooth = never;
		expression.next();
	    }
	    else if (val.equals(always)) {
		fontsmooth = always;
		expression.next();
	    }
	    else if (val.equals(inherit)) {
		fontsmooth = inherit;
		expression.next();
	    }
	} else if (val instanceof CssLength) {
		fontsmooth = val;
		expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }
    
    public CssFontSmooth(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }    
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssFontSmooth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssFontSmooth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getFontSmooth();
	} else {
	    return ((Css3Style) style).cssFontSmooth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssFontSmooth &&
		fontsmooth.equals( ((CssFontSmooth) property).fontsmooth));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "font-smooth";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return fontsmooth;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return fontsmooth.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return fontsmooth.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 fontsmooth == auto;
    }
    
}



--- NEW FILE: CssDropInitialValue.java ---
//
// $Id: CssDropInitialValue.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *
 */

public class CssDropInitialValue extends CssProperty {

    CssValue dropvalue;

    CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssDropInitialValue
     */
    public CssDropInitialValue() {
		dropvalue = initial;
    }

    /**
     * Create a new CssDropInitialValue
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssDropInitialValue(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(initial)) {
		dropvalue = initial;
		expression.next();
	}
	else if (val instanceof CssNumber) {
		dropvalue = val;
		expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssDropInitialValue(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssDropInitialValue != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssDropInitialValue = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getDropInitialValue();
	}
	else {
	    return ((Css3Style) style).cssDropInitialValue;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "drop-initial-value";
    }

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

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

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

    /**
     * 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 dropvalue == initial;
    }

}

--- NEW FILE: CssLineStackingStrategy.java ---
//
// $Id: CssLineStackingStrategy.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */

public class CssLineStackingStrategy extends CssProperty {

    CssValue strategy;

    static CssIdent inlinelineheight = new CssIdent("inline-line-height");

    private static String[] values = {
	"inline-line-height", "block-line-height", "max-height", "grid-height", 
	"inherit", "initial"
    };

    /**
     * Create a new CssLineStackingStrategy
     */
    public CssLineStackingStrategy() {
		strategy = inlinelineheight;
    }

    /**
     * Create a new CssLineStackingStrategy
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssLineStackingStrategy(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		strategy = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", val,
					    getPropertyName(), ac);
	}
    }

    public CssLineStackingStrategy(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssLineStackingStrategy != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssLineStackingStrategy = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getLineStackingStrategy();
	}
	else {
	    return ((Css3Style) style).cssLineStackingStrategy;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "line-stacking-strategy";
    }

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

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

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

    /**
     * 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 (strategy == inlinelineheight);
    }

}

--- NEW FILE: CssBorderTopRightFitLength.java ---
//
// $Id: CssBorderTopRightFitLength.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderTopRightFitLength extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderTopRightFitLength
     */
    public CssBorderTopRightFitLength() {
	value = "overwrite";
    }
    
    /**
     * Create a new CssBorderTopRightFitLength
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderTopRightFitLength(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderTopRightFitLength(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopRightFitLength != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopRightFitLength = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopRightFitLength();
	}
	else {
	    return ((Css3Style) style).cssBorderTopRightFitLength;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopRightFitLength &&
		value.equals(((CssBorderTopRightFitLength) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-right-fit-length";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("overwrite");
    }

}

--- NEW FILE: CssTextUlPos.java ---
//
// $Id: CssTextUlPos.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto-pos || before || after || inherit<BR>
 *  <EM>Initial:</EM>auto-pos<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property sets the position of the underline when set through the
 *  text-decoration property.
 */

public class CssTextUlPos extends CssProperty {

    CssValue ulpos;

    static CssIdent autopos = new CssIdent("auto-pos");
    static CssIdent beforeedge = new CssIdent("before-edge");
    static CssIdent afterbaseline = new CssIdent("after-baseline");
    static CssIdent afteredge = new CssIdent("after-edge");

    /**
     * Create a new CssTextUlPos
     */
    public CssTextUlPos() {
	ulpos = autopos;
    }

    /**
     * Create a new CssTextUlPos
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextUlPos(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(autopos)) {
	    ulpos = autopos;
	    expression.next();
	}
	else if (val.equals(beforeedge)) {
	    ulpos = beforeedge;
	    expression.next();
	}
	else if (val.equals(afterbaseline)) {
	    ulpos = afterbaseline;
	    expression.next();
	}
	else if (val.equals(afteredge)) {
	    ulpos = afteredge;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    ulpos = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value",
					    expression.getValue(),
					    getPropertyName(), ac);
	}

    }

    public CssTextUlPos(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextUlPos != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextUlPos = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextUlPos();
	}
	else {
	    return ((Css3Style) style).cssTextUlPos;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-underline-position";
    }

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

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

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

    /**
     * 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 ulpos == autopos;
    }

}

--- NEW FILE: CssTextOverflow.java ---
//
// $Id: CssTextOverflow.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *
 */

public class CssTextOverflow extends CssProperty
implements CssOperator {

    CssValue textoverflow;
    CssTextOverflowMode tom;
    CssTextOverflowEllipsis toe;

    /**
     * Creates a new CssTextOverflow
     */
    public CssTextOverflow() {
    }

    /**
     * Creates a new CssTextOverflow
     *
     * @param expression The expression for this property
     * @exception InvalidParamException The expression is incorrect
     */
    public CssTextOverflow(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	CssValue val = expression.getValue();
	int maxvalues = 2;
	boolean correct = true;
	char op = SPACE;

	while (correct && (val != null) && (maxvalues-- > 0)) {

	    correct = false;

	    if (tom == null) {
		try {
		    tom = new CssTextOverflowMode(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && toe == null) {
		try {
		    toe = new CssTextOverflowEllipsis(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct) {
		throw new InvalidParamException("value", expression.getValue(),
						getPropertyName(), ac);
	    }

	    val = expression.getValue();
	    op = expression.getOperator();

	}

    }

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

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextOverflow != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextOverflow = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextOverflow();
	}
	else {
	    return ((Css3Style) style).cssTextOverflow;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-overflow";
    }

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

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	String ret = "";
	if (tom != null) {
	    ret += " " + tom.toString();
	}
	if (toe != null) {
	    ret += " " + toe.toString();
	}
	return ret.substring(1);
    }

}

--- NEW FILE: CssGlyphHor.java ---
//
// $Id: CssGlyphHor.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssAngle;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;angle&gt; || inherit<BR>
 *  <EM>Initial:</EM>0<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  glyph-orientation-horizontal' controls glyph orientation when the primary
 *  text advance direction is horizontal.
 */

public class CssGlyphHor extends CssProperty {

    CssValue hor;
    ApplContext ac;
    CssIdent auto = new CssIdent("auto");
    CssIdent inline = new CssIdent("inline");

    /**
     * Create a new CssGlyphHor
     */
    public CssGlyphHor() {
	CssNumber cssnum = new CssNumber(1);
	hor = cssnum;
	this.ac = ac;
    }

    /**
     * Create a new CssGlyphOrHor
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssGlyphHor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    hor = inherit;
	    expression.next();
	} else if (val instanceof CssAngle) {
		hor = val;
		expression.next();
	} else if (val instanceof CssIdent) {
		if (val.equals(auto)) {
			hor = val;
			expression.next();
		} else if (val.equals(inline)) {
			hor = val;
			expression.next();
		} else {
		    throw new InvalidParamException("value", val.toString(),
					    getPropertyName(), ac);
		}
	}
	else {
	    throw new InvalidParamException("value", val.toString(),
					    getPropertyName(), ac);
	}
    }

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

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssGlyphHor != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssGlyphHor = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getGlyphHor();
	}
	else {
	    return ((Css3Style) style).cssGlyphHor;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "glyph-orientation-horizontal";
    }

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

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

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

    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, 1);
	return hor == cssnum;
    }

}

--- NEW FILE: CssLineBoxContain.java ---
//
// $Id: CssLineBoxContain.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssLineBoxContain.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/07/19 20:30:12  sijtsche
 * files representing CSS3 properties
 *
 * Revision 1.1  2002/05/08 09:30:52  dejong
 * CSS version 3 specific properties as in March 2002, all modules
 *
 * Revision 3.1  1997/08/29 13:13:43  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:20  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:13  plehegar
 * Nothing
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;

/**
 *   <H4>
 *     <A NAME="clear">5.5.26 &nbsp;&nbsp; 'clear'</A>
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> [block || inline || font || text || replaced || inline-box ] 
 *   | none | inherit <BR>
 *   <EM>Initial:</EM> block inline replaced<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> yes<BR>
 *   <EM>Percentage values:</EM> N/A<BR>
 *   <P>This property enumerates the aspects of an element that contribute to the 
 *   height of a line line box.</P>
 *
 * @version $Revision: 1.1 $ */
public class CssLineBoxContain extends CssProperty {
    
    CssValue value;

    private static String[] values = {
	"block", "inline", "font", "text", "replaced", "inline-box",
	"none", "inherit"
    };
    
    /**
     * Create a new CssLineBoxContain
     */
    public CssLineBoxContain() {
	// nothing to do
    }  
    
    /**
     * Create a new CssLineBoxContain
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public CssLineBoxContain(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();
	
	setByUser();
	
	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		value = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}

    }
    
    public CssLineBoxContain(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "line-box-contain";
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssLineBoxContain != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssLineBoxContain = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getLineBoxContain();
	} else {
	    return ((Css3Style) style).cssLineBoxContain;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssLineBoxContain && 
		value == ((CssLineBoxContain) property).value);
    }
    
    /**
     * Is the value of this property is a default value.
     * It is used by all macro for the function <code>print</code>
     */  
    public boolean isDefault() {
	return false;
    }
    
}

--- NEW FILE: CssLineGrid.java ---
//
// $Id: CssLineGrid.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *
 */

public class CssLineGrid extends CssProperty
implements CssOperator {

    CssValue linegrid;
    CssLineGridMode lgm;
    CssLineGridProgression lgp;

    /**
     * Creates a new CssLineGrid
     */
    public CssLineGrid() {
    }

    /**
     * Creates a new CssLineGrid
     *
     * @param expression The expression for this property
     * @exception InvalidParamException The expression is incorrect
     */
    public CssLineGrid(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	CssValue val = expression.getValue();
	int maxvalues = 2;
	boolean correct = true;
	char op = SPACE;

	while (correct && (val != null) && (maxvalues-- > 0)) {

	    correct = false;

	    if (lgm == null) {
		try {
		    lgm = new CssLineGridMode(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && lgp == null) {
		try {
		    lgp = new CssLineGridProgression(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct) {
		throw new InvalidParamException("value", expression.getValue(),
						getPropertyName(), ac);
	    }

	    val = expression.getValue();
	    op = expression.getOperator();

	}

    }

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

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssLineGrid != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssLineGrid = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getLineGrid();
	}
	else {
	    return ((Css3Style) style).cssLineGrid;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "line-grid";
    }

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

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	String ret = "";
	if (lgp != null) {
	    ret += " " + lgp.toString();
	}
	if (lgm != null) {
	    ret += " " + lgm.toString();
	}
	return ret.substring(1);
    }

}

--- NEW FILE: MediaDeviceAspectRatio.java ---
//
// $Id: MediaDeviceAspectRatio.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaDeviceAspectRatio.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:05:40  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaDeviceAspectRatio extends CssProperty implements CssOperator {

    String value = "";

    /**
     * Create a new MediaDeviceAspectRatio
     */
    public MediaDeviceAspectRatio() {
		//empty
    }

    /**
     * Create a new MediaDeviceAspectRatio.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaDeviceAspectRatio(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	char op = SPACE;
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val.toString();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    op = expression.getOperator();
	    expression.next();
	    val = expression.getValue();
	    
	    if (op == SLASH && val != null) {
		
		if (val instanceof CssNumber) {
		    if (((CssNumber) val).isInteger()) {
			value += "/" + val.toString();
		    } else {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
		
		
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	    
	}
    }

    public MediaDeviceAspectRatio(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "device-aspect-ratio";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
		return false;
    }

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaDeviceAspectRatio != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaDeviceAspectRatio = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaDeviceAspectRatio();
	} else {
	    return ((Css3Style) style).mediaDeviceAspectRatio;
	}
    }

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

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

}

--- NEW FILE: MediaMaxResolution.java ---
//
// $Id: MediaMaxResolution.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMaxResolution.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:04:22  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssResolution;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMaxResolution extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMaxResolution
     */
    public MediaMaxResolution() {
		//empty
    }

    /**
     * Create a new MediaMaxResolution.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMaxResolution(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssResolution) {
		value = val;
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaMaxResolution(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "max-resolution";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMaxResolution != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMaxResolution = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMaxResolution();
	} else {
	    return ((Css3Style) style).mediaMaxResolution;
	}
    }

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

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

}

--- NEW FILE: CssTextLTColor.java ---
//
// $Id: CssTextLTColor.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM>  auto || &lt;color&gt; || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies the color for the line-through.
 */

public class CssTextLTColor extends CssProperty {
 
    CssValue ltcolor;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssTextLTColor
     */
    public CssTextLTColor() {
	ltcolor = auto;
    }

    /**
     * Create a new CssTextLTColor
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextLTColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val instanceof org.w3c.css.values.CssColor) {
	    ltcolor = val;
	    expression.next();
	}
        else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		ltcolor = inherit;
		expression.next();
	    }
	    else if (val.equals(auto)) {
		ltcolor = auto;
		expression.next();
	    }
	    else {
		ltcolor = new org.w3c.css.values.CssColor(ac, (String) val.get());
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", 
					    expression.getValue(), 
					    getPropertyName(), ac);
	}
    }

    public CssTextLTColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextLTColor != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextLTColor = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextLTColor();
	}
	else {
	    return ((Css3Style) style).cssTextLTColor;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextLTColor &&
		ltcolor.equals(((CssTextLTColor) property).ltcolor));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-line-through-color";
    }

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

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

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

    /**
     * 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 ltcolor == auto;
    }

}


--- NEW FILE: CssKerningMode.java ---
//
// $Id: CssKerningMode.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || pair || contextual || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property controls all kerning effects.
 */

public class CssKerningMode extends CssProperty {
 
    CssValue mode;

    static CssIdent none = new CssIdent("none");
    static CssIdent pair = new CssIdent("pair");
    static CssIdent contextual = new CssIdent("contextual");

    /**
     * Create a new CssKerningMode
     */
    public CssKerningMode() {
	mode = none;
    }

    /**
     * Create a new CssKerningMode
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssKerningMode(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(none)) {
	    mode = none;
	    expression.next();
	}
	else if (val.equals(pair)) {
	    mode = pair;
	    expression.next();
	}
	else if (val.equals(contextual)) {
	    mode = contextual;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    mode = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }

    public CssKerningMode(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssKerningMode != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssKerningMode = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getKerningMode();
	}
	else {
	    return ((Css3Style) style).cssKerningMode;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssKerningMode &&
		mode.equals(((CssKerningMode) property).mode));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "kerning-mode";
    }

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

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

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

    /**
     * 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 mode == none;
    }

}

--- NEW FILE: CssTextJustifyTrim.java ---
//
// $Id: CssTextJustifyTrim.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || punctuation || punctuation-and-kana || inherit<BR>
 *  <EM>Initial:</EM>punctuation<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This sets the individual font blank space compression permissions for
 *  the text justification algorithm, when 'text-justify' is anything other
 *  than 'inter-word'. This special type of space compression occurs on the
 *  font level, i.e. the blank space within the character area itself may be
 *  reduced without affecting the appearance of the glyph. This applies to
 *  wide-cell glyphs only.
 */

public class CssTextJustifyTrim extends CssProperty {

    CssValue trim;

    static CssIdent none = new CssIdent("none");
    static CssIdent punctuation = new CssIdent("punctuation");
    static CssIdent punctkana = new CssIdent("punctuation-and-kana");

    /**
     * Create a new CssTextJustifyTrim
     */
    public CssTextJustifyTrim() {
	trim = punctuation;
    }

    /**
     * Create a new CssTextJustifyTrim
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssTextJustifyTrim(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(none)) {
	    trim = none;
	    expression.next();
	}
	else if (val.equals(punctuation)) {
	    trim = punctuation;
	    expression.next();
	}
	else if (val.equals(punctkana)) {
	    trim = punctkana;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    trim = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextJustifyTrim(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextJustifyTrim != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextJustifyTrim = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextJustifyTrim();
	}
	else {
	    return ((Css3Style) style).cssTextJustifyTrim;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-justify-trim";
    }

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

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

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

    /**
     * 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 trim == punctuation;
    }

}



--- NEW FILE: CssDominantBaseLine.java ---
//
// $Id: CssDominantBaseLine.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || autosense-script || no-change || reset-size ||
 *  ideographic || alphabetic || hanging || mathematical || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'dominant-baseline' property is used:
 *   <UL>
 *     <LI>to determine the dominant baseline
 *     <LI>to select the baseline-table
 *     <LI>to establish the font-size used with the baseline-table
 *   </UL>
 */

public class CssDominantBaseLine extends CssProperty {

    CssValue dombaseline;

    static CssIdent auto = new CssIdent("auto");

    private static String[] values = {
	"auto", "use-script", "no-change", "reset-size",
	"ideographic", "alphabetic", "hanging", "mathematical",
	"central", "middle", "text-after-edge", "text-before-edge",
	"inherit", "initial"
    };

    /**
     * Create a new CssDominantBaseLine
     */
    public CssDominantBaseLine() {
	dombaseline = auto;
    }

    /**
     * Create a new CssDominantBaseLine
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssDominantBaseLine(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		dombaseline = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssDominantBaseLine(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssDominantBaseLine != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssDominantBaseLine = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getDominantBaseLine();
	}
	else {
	    return ((Css3Style) style).cssDominantBaseLine;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "dominant-baseline";
    }

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

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

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

    /**
     * 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 (dombaseline == auto);
    }

}



--- NEW FILE: MediaMinDeviceAspectRatio.java ---
//
// $Id: MediaMinDeviceAspectRatio.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMinDeviceAspectRatio.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:02:55  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMinDeviceAspectRatio extends CssProperty implements CssOperator {

    String value = "";

    /**
     * Create a new MediaMinDeviceAspectRatio
     */
    public MediaMinDeviceAspectRatio() {
		//empty
    }

    /**
     * Create a new MediaMinDeviceAspectRatio.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMinDeviceAspectRatio(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 2) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	char op = SPACE;
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val.toString();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    op = expression.getOperator();
	    expression.next();
	    val = expression.getValue();
	    
	    if (op == SLASH && val != null) {
		
		if (val instanceof CssNumber) {
		    if (((CssNumber) val).isInteger()) {
			value += "/" + val.toString();
		    } else {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
		
		
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	    
	}
    }
    
    public MediaMinDeviceAspectRatio(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-device-aspect-ratio";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
		return false;
    }

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMinDeviceAspectRatio != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMinDeviceAspectRatio = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMinDeviceAspectRatio();
	} else {
	    return ((Css3Style) style).mediaMinDeviceAspectRatio;
	}
    }

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

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

}

--- NEW FILE: CssColumnSpaceDistribution.java ---
//
// $Id: CssColumnSpaceDistribution.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> right || left || start || end || top || bottom || inner ||
 *   outer || between || outside || inherit<BR>
 *  <EM>Initial:</EM>end<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property describes how to interpret 'column-width'. The 'flexible'
 *  value indicates that the width of columns can be increased to fill all
 *  the available space. The 'strict' value indicates that 'column-width' is
 *  to be honored.
 */

public class CssColumnSpaceDistribution extends CssProperty implements CssOperator {
    
    String distribution = "";
    
    static CssIdent end = new CssIdent("end");
    
    private static String[] values = {
	"start", "end", "inner", "outer", "between", "inherit"
    };
    
    /**
     * Create a new CssColumnSpaceDistribution
     */
    public CssColumnSpaceDistribution() {
	// nothing to do
    }
    
    /**
     * Create a new CssColumnSpaceDistribution
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssColumnSpaceDistribution(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	
	CssValue val = expression.getValue();
	int maxvalues = 2;
	boolean correct = true;
	char op = SPACE;
	
	while (correct && (val != null) && (maxvalues-- > 0)) {
	    
	    correct = false;
	    
	    for (int i = 0; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    distribution += " " + val.toString();
		    expression.next();
		    correct = true;
		    break;
		}
	    }
	    
	    if (!correct) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    val = expression.getValue();
	    op = expression.getOperator();
	    
	}
	
    }
    
    public CssColumnSpaceDistribution(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssColumnSpaceDistribution != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssColumnSpaceDistribution = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getColumnSpaceDistribution();
	}
	else {
	    return ((Css3Style) style).cssColumnSpaceDistribution;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssColumnSpaceDistribution &&
		distribution.equals(((CssColumnSpaceDistribution) property).distribution));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "column-space-distribution";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return distribution;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return distribution.equals("inherit");
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return distribution;
    }
    
    /**
     * 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 (distribution.equals("end"));
    }
    
}

--- NEW FILE: MediaScan.java ---
//
// $Id: MediaScan.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaScan.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:01:44  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaScan extends CssProperty {

    CssValue value;
    CssIdent progressive = new CssIdent("progressive");
    CssIdent interlace = new CssIdent("interlace");

    /**
     * Create a new MediaScan
     */
    public MediaScan() {
		//empty
    }

    /**
     * Create a new MediaScan.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaScan(ApplContext ac, CssExpression expression, boolean check)
    	throws InvalidParamException {
	CssValue val = null;
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		if (val.equals(progressive) || val.equals(interlace)) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
		
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaScan(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "scan";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaScan != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaScan = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaScan();
	} else {
	    return ((Css3Style) style).mediaScan;
	}
    }

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

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

}

--- NEW FILE: CssWrapOption.java ---
//
// $Id: CssWrapOption.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */
public class CssWrapOption extends CssProperty {
    
    CssValue wrapoption;
    
    private static CssIdent wrap = new CssIdent("wrap");
    private static CssIdent softwrap = new CssIdent("soft-wrap");
    private static CssIdent hardwrap = new CssIdent("hard-wrap");
    private static CssIdent emergency = new CssIdent("emergency");
    
    /**
     * Create a new CssWrapOption
     */
    public CssWrapOption() {
	wrapoption = wrap;
    }
    
    /**
     * Create a new CssWrapOption
     *
     *
     */
    public CssWrapOption(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(wrap)) {
	    wrapoption = wrap;
	    expression.next();
	}
	else if (val.equals(softwrap)) {
	    wrapoption = softwrap;
	    expression.next();
	}
	else if (val.equals(hardwrap)) {
	    wrapoption = hardwrap;
	    expression.next();
	}
	else if (val.equals(emergency)) {
	    wrapoption = emergency;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    wrapoption = inherit;
	    expression.next();
	}
	
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssWrapOption(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssWrapOption != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssWrapOption = this;
	
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getWrapOption();
	} else {
	    return ((Css3Style) style).cssWrapOption;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssWrapOption &&
		wrapoption.equals( ((CssWrapOption) property).wrapoption));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "wrap-option";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return wrapoption;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return wrapoption.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return wrapoption.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 wrapoption == wrap;
    }
    
}

--- NEW FILE: CssBorderTopFitWidth.java ---
//
// $Id: CssBorderTopFitWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderTopFitWidth extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderTopFitWidth
     */
    public CssBorderTopFitWidth() {
	value = "repeat";
    }
    
    /**
     * Create a new CssBorderTopFitWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderTopFitWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
        
    public CssBorderTopFitWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopFitWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopFitWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopFitWidth();
	}
	else {
	    return ((Css3Style) style).cssBorderTopFitWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopFitWidth &&
		value.equals(((CssBorderTopFitWidth) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-fit-width";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }
    
}

--- NEW FILE: CssUserInput.java ---
//
// $Id: CssUserInput.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || enabled || disabled || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:all
 *  <P>
 *  The purpose of this property is to allow the author to specify whether or 
 *  not a user interface element will currently accept user input. Typically 
 *  this will be used to enable or disable specific input elements in a form. 
 *  UAs may interpret none as disabled for user interface related elements.
 */

public class CssUserInput extends CssProperty {

    CssValue userinput;
    static CssIdent none = new CssIdent("none");
    static CssIdent enabled = new CssIdent("enabled");
    static CssIdent disabled = new CssIdent("disabled");

    /**
     * Create a new CssUserInput
     */
    public CssUserInput() {
	userinput = none;
    }

    /**
     * Create a new CssUserInput
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssUserInput(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(none)) {
	    userinput = none;
	    expression.next();
	}
	else if (val.equals(enabled)) {
	    userinput = enabled;
	    expression.next();
	}
	else if (val.equals(disabled)) {
	    userinput = disabled;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    userinput = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssUserInput(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssUserInput != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssUserInput = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getUserInput();
	}
	else {
	    return ((Css3Style) style).cssUserInput;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssUserInput &&
		userinput.equals(((CssUserInput) property).userinput));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "user-input";
    }

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

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

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

    /**
     * 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 userinput == none;
    }

}

--- NEW FILE: CssUserSelect.java ---
//
// $Id: CssUserSelect.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || text || toggle || element || elements || all ||
 *  inherit<BR>
 *  <EM>Initial:</EM>read-only<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:interactive
 *  <P>
 *  This property controls the selection model and granularity of an element. 
 *  Additional selection models may be added in the future.
 */

public class CssUserSelect extends CssProperty {

    CssValue userselect;

    static CssIdent none = new CssIdent("none");
    static CssIdent text = new CssIdent("text");
    static CssIdent toggle = new CssIdent("toggle");
    static CssIdent element = new CssIdent("element");
    static CssIdent elements = new CssIdent("elements");
    static CssIdent all = new CssIdent("all");

    /** 
     * Create a new CssUserSelect
     */
    public CssUserSelect() {
	userselect = text;
    }

    /**
     * Create a new CssUserSelect
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssUserSelect(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(none)) {
	    userselect = none;
	    expression.next();
	}
	else if (val.equals(toggle)) {
	    userselect = toggle;
	    expression.next();
	}
	else if (val.equals(element)) {
	    userselect = element;
	    expression.next();
	}
	else if (val.equals(elements)) {
	    userselect = element;
	    expression.next();
	}
	else if (val.equals(all)) {
	    userselect = all;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    userselect = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssUserSelect(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssUserSelect != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssUserSelect = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getUserSelect();
	}
	else {
	    return ((Css3Style) style).cssUserSelect;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssUserSelect &&
		userselect.equals(((CssUserSelect) property).userselect));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "user-select";
    }

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

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

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

    /**
     * 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 userselect == text;
    }

}

--- NEW FILE: CssTextOverflowEllipsis.java ---
//
// $Id: CssTextOverflowEllipsis.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssURL;
import org.w3c.css.values.CssValue;

/**
 *
 */

    public class CssTextOverflowEllipsis extends CssProperty {

	String overflowellipsis;

	/**
	 * Create a new CssTextOverflowEllipsis
	 */
	public CssTextOverflowEllipsis() {
	    overflowellipsis = "...";
	}
	
	/**
	 * Create a new CssTextOverflowEllipsis
	 *
	 *
	 */
	public CssTextOverflowEllipsis(ApplContext ac, CssExpression expression,
		boolean check) throws InvalidParamException {
	    setByUser();
	    CssValue val = expression.getValue();
	    CssValue val2 = null;
	    
	    if (val instanceof CssIdent) {
		overflowellipsis = val.toString();
		expression.next();
	    }
	    else if (val instanceof CssURL) {
		overflowellipsis = val.toString();
		expression.next();
	    }
	    else {
		throw new InvalidParamException("value", val.toString(),
			getPropertyName(), ac);
	    }
	    
	    val2 = expression.getValue();
	    
	    if (val2 != null) {
		
		if (val2 instanceof CssIdent) {
		    overflowellipsis += " " + val2.toString();
		    expression.next();
		}
		else if (val2 instanceof CssURL) {
		    overflowellipsis += " " + val2.toString();
		    expression.next();
		}
		else {
		    throw new InvalidParamException("value",
			    val2.toString(), getPropertyName(), ac);
		}
	    }
	}

	public CssTextOverflowEllipsis(ApplContext ac, CssExpression expression)
		throws InvalidParamException {
	    this(ac, expression, false);
	}
	
	/**
	 * Add this property to the CssStyle.
	 *
	 * @param style The CssStyle
	 */
	public void addToStyle(ApplContext ac, CssStyle style) {
	    if (((Css3Style) style).cssTextOverflowEllipsis != null)
		style.addRedefinitionWarning(ac, this);
	    ((Css3Style) style).cssTextOverflowEllipsis = this;

	}

	/**
	 * Get this property in the style.
	 *
	 * @param style The style where the property is
	 * @param resolve if true, resolve the style to find this property
	 */
        public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	    if (resolve) {
		return ((Css3Style) style).getTextOverflowEllipsis();
	    } else {
		return ((Css3Style) style).cssTextOverflowEllipsis;
	    }
	}

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

	/**
	 * Returns the name of this property
	 */
	public String getPropertyName() {
	    return "text-overflow-ellipsis";
	}

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

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

	/**
	 * Returns a string representation of the object
	 */
	public String toString() {
	    return overflowellipsis.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 overflowellipsis.equals("...");
	}

    }

--- NEW FILE: CssFloatDisplace.java ---
//
// $Id: CssFloatDisplace.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none | block | line | list-item | marker | run-in | compact |
 *  table-row | table-cell | table-row-group | table-header-group | table-footer-group |
 *  table-column | table-column-group | table-caption | ruby-text | ruby-base |
 *  ruby-base-group | ruby-text-group | inherited <BR>
 *  <EM>Initial:</EM>line<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssFloatDisplace extends CssProperty {

    CssValue fd;

    static CssIdent line = new CssIdent("line");

    private static String[] values = {
		"line", "indent", "block", "block-within-page", "initial", "inherit"
    };

    /**
     * Create a new CssFloatDisplace
     */
    public CssFloatDisplace() {
		fd = line;
    }

    /**
     * Create a new CssFloatDisplace
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssFloatDisplace(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		fd = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssFloatDisplace(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssFloatDisplace != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssFloatDisplace = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getFloatDisplace();
	}
	else {
	    return ((Css3Style) style).cssFloatDisplace;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
		return "float-displace";
    }

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

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

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

    /**
     * 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 (fd == line);
    }

}

--- NEW FILE: CssBorderTopRightRadius.java ---
//
// $Id: CssBorderTopRightRadius.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssValue;

public class CssBorderTopRightRadius extends CssProperty {
    
    String value;
    ApplContext ac;
    
    /**
     * Create new CssBorderTopRightRadius
     */
    public CssBorderTopRightRadius() {
	CssNumber cssnum =  new CssNumber((float) 1.0);
	value = cssnum.toString();
    }
    
    /**
     * Create new CssBorderTopRightRadius
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderTopRightRadius(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssLength) {
	    value = val.toString();
	    expression.next();
	    
	    val = expression.getValue();
	    if (val != null) {
		
		if (val instanceof CssLength) {
		    value += " " + val.toString();
		    expression.next();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBorderTopRightRadius(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopRightRadius != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopRightRadius = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopRightRadius();
	} else {
	    return ((Css3Style) style).cssBorderTopRightRadius;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopRightRadius &&
		value.equals( ((CssBorderTopRightRadius) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-right-radius";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: CssDropInitialSize.java ---
//
// $Id: CssDropInitialSize.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || &lt;percentage&gt; || &lt;length&gt; || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>refers to the 'line-height' of the element<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'alignment-adjust' property allows more precise alignment of
 *  elements, such as graphics, that do not have a baseline-table
 *  or lack the desired baseline in their baseline-table. With the
 *  'alignment-adjust' property, the position of the baseline
 *  identified by the 'alignment-baseline' can be explicitly determined.
 */

public class CssDropInitialSize extends CssProperty {

    CssValue dropvalue;

    CssIdent auto = new CssIdent("auto");
    CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssDropInitialSize
     */
    public CssDropInitialSize() {
		dropvalue = auto;
    }

    /**
     * Create a new CssDropInitialSize
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssDropInitialSize(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(auto)) {
		dropvalue = auto;
		expression.next();
	}
	else if (val.equals(initial)) {
		dropvalue = initial;
		expression.next();
	}
	else if (val instanceof CssNumber) {
		dropvalue = val;
		expression.next();
	}
	else if (val instanceof CssPercentage) {
	    dropvalue = val;
	    expression.next();
	}
	else if (val instanceof CssLength) {
	    dropvalue = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssDropInitialSize(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssDropInitialSize != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssDropInitialSize = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getDropInitialSize();
	}
	else {
	    return ((Css3Style) style).cssDropInitialSize;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "drop-initial-size";
    }

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

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

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

    /**
     * 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 dropvalue == auto;
    }

}

--- NEW FILE: CssMarginInside.java ---
//
// $Id: CssMarginInside.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssMarginInside.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/07/19 20:30:12  sijtsche
 * files representing CSS3 properties
 *
 * Revision 1.1  2002/05/08 09:30:52  dejong
 * CSS version 3 specific properties as in March 2002, all modules
 *
 * Revision 3.1  1997/08/29 13:13:55  plehegar
 * Freeze
 *
 * Revision 1.4  1997/08/20 11:41:26  plehegar
 * Freeze
 *
 * Revision 1.3  1997/08/06 17:30:11  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:20:10  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/24 00:08:17  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssMarginSide;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'margin-inside'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> &lt;length&gt; | &lt;percentage&gt; | auto<BR>
 *   <EM>Initial:</EM> 0<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> refer to parent element's width<BR>
 *   <P>
 *   This property sets the left margin of an element:
 *   <PRE>
 *   H1 { margin-inside: 2em }
 * </PRE>
 *   <P>
 *   A negative value is allowed, but there may be implementation-specific limits.
 * @version $Revision: 1.1 $
 */
public class CssMarginInside extends CssMarginSide {

  /**
   * Create a new CssMarginInside
   */
  public CssMarginInside() {
    super();
  }
  
  /**
   * Create a new CssMarginInside with an another CssMarginSide
   *
   * @param another The another side.
   */
  public CssMarginInside(CssMarginSide another) {
    super(another);
  }
  
  /**
   * Create a new CssMarginInside
   *
   * @param expression The expression foir this property.
   * @exception InvalidParamException Values are incorrect
   */
  public CssMarginInside(ApplContext ac, CssExpression expression,
	  boolean check) throws InvalidParamException {
    super(ac, expression, check);
  }
  
  public CssMarginInside(ApplContext ac, CssExpression expression)
	throws InvalidParamException {
    this(ac, expression, false);
  }
  
  /**
   * Returns the name of this property
   */  
  public String getPropertyName() {
    return "margin-inside";
  }

  /**
   * Add this property to the CssStyle.
   *
   * @param style The CssStyle
   */
  public void addToStyle(ApplContext ac, CssStyle style) {
    Css3Style style0 = (Css3Style) style;
    if (style0.cssMarginInside != null)
      style0.addRedefinitionWarning(ac, this);
    style0.cssMarginInside = this;
  }

  /**
   * Get this property in the style.
   *
   * @param style The style where the property is
   * @param resolve if true, resolve the style to find this property
   */  
  public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
    if (resolve) {
      return ((Css3Style) style).getMarginInside();
    } else {
      return ((Css3Style) style).cssMarginInside;
    }
  }

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

}

--- NEW FILE: CssRubySpan.java ---
//
// $Id: CssRubySpan.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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 java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || &lt;key-press-combination&gt;+ || &lt;system-key-equivalent&gt; || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all enabled elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:interactive
 */

public class CssRubySpan extends CssProperty {

    CssValue rubyspan;
    Vector values = new Vector();

    CssIdent none = new CssIdent("none");

    /**
     * Create a new CssRubySpan
     */
    public CssRubySpan() {
	rubyspan = none;
    }

    /**
     * Create a new CssRubySpan
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssRubySpan(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	//String kc = new String();
	//int hyphenindex;
	//int counter = 0;
	//char op = expression.getOperator();
	CssValue val = expression.getValue();
	//String part = new String();
	//String rest = new String();
	//Vector ks = new Vector();
	setByUser();
	
	if (val.equals(none)) {
	    rubyspan = none;
	    expression.next();
	    return;
	}
	else if (val.equals(inherit)) {
	    rubyspan = inherit;
	    expression.next();
	    return;
	}
	else if (val instanceof CssFunction) {
	    CssFunction attr = (CssFunction) val;
	    CssExpression params = attr.getParameters();
	    CssValue v = params.getValue();
	    if (attr.getName().equals("attr")) {
		if ((params.getCount() != 1)
			|| !(v instanceof CssIdent)) {
		    throw new InvalidParamException("attr", params.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	    rubyspan = val;
	    expression.next();
	    return;
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
    }

    public CssRubySpan(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssRubySpan != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssRubySpan = this;

    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getRubySpan();
	} else {
	    return ((Css3Style) style).cssRubySpan;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "ruby-span";
    }

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

    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	// @@TODO
	return false;
	//values.equals(inherit);
    }

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (rubyspan != null)
	    return rubyspan.toString();
	else
	    return values.firstElement().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 rubyspan == none;
    }

}

--- NEW FILE: CssBackgroundSize.java ---
//
// $Id: CssBackgroundSize.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche Smeman (sijtsche@wisdom.nl)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html

package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'background-size'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> [&lt;length&gt; | &lt;percentage&gt | auto]{1.2};<BR>
 *   <EM>Initial:</EM> auto<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> yes<BR>
 *   <EM>Percentage values:</EM> see text<BR>
 *   <P>
 *   In case there is a 'background-image', the background-size can be used to stretch or shrink it.
 *   If the property has only one value, it applies both horizontally and vertically. If there are
 *   two, the first one refers to the width, the second to the height of the background image.
 */
public class CssBackgroundSize extends CssProperty  {

    public CssValue value1 = null;
    CssValue value2 = null;
    CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssBackgroundSize
     */
    public CssBackgroundSize() {
    }

    /**
     * Create a new CssBackgroundSize
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBackgroundSize(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	for (int i = 0; i < 2; i++) {
	    
	    CssValue val = expression.getValue();
	    
	    setByUser();
	    
	    if ((i == 0) || (i == 1 && val != null)) {
		
		if (val.equals(auto)) {
		    if (i == 0) {
			value1 = auto;
		    } else {
			value2 = auto;
		    }
		} else if (val instanceof CssLength || val instanceof CssPercentage) {
		    if (i == 0) {
			value1 = val;
		    } else {
			value2 = val;
		    }
		} else if (val instanceof CssNumber) {
		    if (i == 0) {
			value1 = ((CssNumber) val).getLength();
		    } else {
			value2 = ((CssNumber) val).getLength();
		    }
		} else {
		    throw new InvalidParamException("value", val.toString(),
			    getPropertyName(), ac);
		}
		
		expression.next();
	    }
	}
    }

    public CssBackgroundSize(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBackgroundSize != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBackgroundSize = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getCssBackgroundSize();
	}
	else {
	    return ((Css3Style) style).cssBackgroundSize;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "background-size";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value1;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return false;
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (value2 == null) {
	    return value1.toString();
	} else {
	    return value1.toString() + " " + value2.toString();
	}
    }
    
    /**
     * 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 value1 == auto;
    }

}

--- NEW FILE: CssBorderTopRightImage.java ---
//
// $Id: CssBorderTopRightImage.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;



public class CssBorderTopRightImage extends CssProperty {
    
    String value = "";
    ApplContext ac;
    CssIdent contin = new CssIdent("continue");
    CssIdent none = new CssIdent("none");
    
    /**
     * Create new CssBorderTopRightImage
     */
    public CssBorderTopRightImage() {
	value = "continue";
    }
    
    /**
     * Create new CssBorderTopRightImage
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderTopRightImage(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val != null) {
	    if (val.equals(none)) {
		value = "none";
	    } else if (val.equals(contin)) {
		value = "continue";
	    } else if (val instanceof CssURL) {
		value = val.toString();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	expression.next();
    }
    
    public CssBorderTopRightImage(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopRightImage != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopRightImage = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopRightImage();
	} else {
	    return ((Css3Style) style).cssBorderTopRightImage;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopRightImage &&
		value.equals( ((CssBorderTopRightImage) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-right-image";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: CssBoxWidth.java ---
//
// $Id: CssBoxWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;length&gt; || &lt;percentage&gt; || auto || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>same as 'width' and 'height'<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssBoxWidth extends CssProperty {

    CssValue boxwidth;
    ApplContext ac;

    CssIdent auto = new CssIdent("auto");
    CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssBoxWidth
     */
    public CssBoxWidth() {
	boxwidth = auto;
    }

    /**
     * Create a new CssBoxWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBoxWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(auto)) {
	    boxwidth = auto;
	    expression.next();
	}
	else if (val.equals(initial)) {
		boxwidth = initial;
		expression.next();
	}
	else if (val.equals(inherit)) {
	    boxwidth = inherit;
	    expression.next();
	}
	else if (val instanceof CssLength) {
	    boxwidth = val;
	    expression.next();
	} else if (val instanceof CssPercentage) {
	    boxwidth = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssBoxWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBoxWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBoxWidth = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBoxWidth();
	} else {
	    return ((Css3Style) style).cssBoxWidth;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "box-width";
    }

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

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return boxwidth.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 boxwidth == auto;
    }

}

--- NEW FILE: CssBorderRightFitWidth.java ---
//
// $Id: CssBorderRightFitWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderRightFitWidth extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderRightFitWidth
     */
    public CssBorderRightFitWidth() {
	value = "repeat";
    }
    
    /**
     * Create a new CssBorderRightFitWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderRightFitWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderRightFitWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderRightFitWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderRightFitWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderRightFitWidth();
	}
	else {
	    return ((Css3Style) style).cssBorderRightFitWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderRightFitWidth &&
		value.equals(((CssBorderRightFitWidth) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-right-fit-width";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }
    
}

--- NEW FILE: CssTextHeight.java ---
//
// $Id: CssTextHeight.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */

public class CssTextHeight extends CssProperty {

    CssValue textheight;

    static CssIdent auto = new CssIdent("auto");

    private static String[] values = {
	"auto", "font-size", "text-size", "max-size", "inherit", "initial"
    };

    /**
     * Create a new CssTextHeight
     */
    public CssTextHeight() {
		textheight = auto;
    }

    /**
     * Create a new CssTextHeight
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssTextHeight(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		textheight = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextHeight(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextHeight != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextHeight = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextHeight();
	}
	else {
	    return ((Css3Style) style).cssTextHeight;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-height";
    }

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

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

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

    /**
     * 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 (textheight == auto);
    }

}

--- NEW FILE: CssLink.java ---
//
// $Id: CssLink.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2003  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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none | <url> | attr(X) | down-attr(X) | up-attr(X) |
 *                                                                 inherit <BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:all
 *  <P>
 *  Specifies whether an element is the source of a link and where to find 
 *  the URL of the link target.
 */

public class CssLink extends CssProperty {

    CssValue link;

    static CssIdent none = new CssIdent("none");

    /**
     * Create a new CssLink
     */
    public CssLink() {
	link = none;
    }

    /**
     * Create a new CssLink
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssLink(ApplContext ac, CssExpression expression, boolean check)
	throws InvalidParamException {

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

	if (val.equals(none)) {
	    link = none;
	    expression.next();
	} else if (val.equals(inherit)) {
	    link = inherit;
	    expression.next();
	} else if (val instanceof CssFunction) {
	    CssFunction attr = (CssFunction) val;
	    CssExpression params = attr.getParameters();
	    CssValue v = params.getValue();
	    
	    if (attr.getName().equals("attr")) {		
		if ((params.getCount() != 1)
		    || !(v instanceof CssIdent)) {
		    throw new InvalidParamException("attr", 
						    params.getValue(), 
						    getPropertyName(), ac);
		}
	    } else if (attr.getName().equals("down-attr")) {
		if ((params.getCount() != 1)
		    || !(v instanceof CssIdent)) {
		    throw new InvalidParamException("function", 
						    params.getValue(), 
						    getPropertyName(), ac);
		}
	    } else if (attr.getName().equals("up-attr")) {
		if ((params.getCount() != 1)
		    || !(v instanceof CssIdent)) {
		    throw new InvalidParamException("function", 
						    params.getValue(), 
						    getPropertyName(), ac);
		}
	    }
	    else{
		throw new InvalidParamException("value", expression.getValue(),
						getPropertyName(), ac);
	    }
	}
    }

    public CssLink(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssLink != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssLink = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getLink();
	}
	else {
	    return ((Css3Style) style).cssLink;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssLink &&
		link.equals(((CssLink) property).link));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "link";
    }

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

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

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

    /**
     * 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 (link == none);
    }

}

--- NEW FILE: CssWhiteSpaceTreatment.java ---
//
// $Id: CssWhiteSpaceTreatment.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */

    public class CssWhiteSpaceTreatment extends CssProperty {

	CssValue wstreat;

	private static CssIdent ignore = new CssIdent("ignore");
	private static CssIdent preserve = new CssIdent("preserve");
	private static CssIdent ignoreifbeforelf = new CssIdent("ignore-if-before-linefeed");
	private static CssIdent ignoreifafterlf = new CssIdent("ignore-if-after-linefeed");
	private static CssIdent ignoreifsurroundinglf = new CssIdent("ignore-if-surrounding-linefeed");

	/**
	 * Create a new CssWhiteSpaceTreatment
	 */
	public CssWhiteSpaceTreatment() {
	    wstreat = ignoreifsurroundinglf;
	}

	/**
	 * Create a new CssWhiteSpaceTreatment
	 *
	 *
	 */
	public CssWhiteSpaceTreatment(ApplContext ac, CssExpression expression,
		boolean check) throws InvalidParamException {
	    setByUser();
	    CssValue val = expression.getValue();
	    if (val.equals(ignore)) {
			wstreat = ignore;
			expression.next();
	    }
	    else if (val.equals(preserve)) {
			wstreat = preserve;
			expression.next();
	    }
	    else if (val.equals(ignoreifbeforelf)) {
			wstreat = ignoreifbeforelf;
			expression.next();
	    }
	    else if (val.equals(ignoreifafterlf)) {
			wstreat = ignoreifafterlf;
			expression.next();
	    }
	    else if (val.equals(ignoreifsurroundinglf)) {
			wstreat = ignoreifsurroundinglf;
			expression.next();
	    }
	    else if (val.equals(inherit)) {
			wstreat = inherit;
			expression.next();
	    }

	    else {
		throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	    }
	}

	public CssWhiteSpaceTreatment(ApplContext ac, CssExpression expression)
		throws InvalidParamException {
	    this(ac, expression, false);
	}
	
	/**
	 * Add this property to the CssStyle.
	 *
	 * @param style The CssStyle
	 */
	public void addToStyle(ApplContext ac, CssStyle style) {
	    if (((Css3Style) style).cssWhiteSpaceTreatment != null)
		style.addRedefinitionWarning(ac, this);
	    ((Css3Style) style).cssWhiteSpaceTreatment = this;

	}

	/**
	 * Get this property in the style.
	 *
	 * @param style The style where the property is
	 * @param resolve if true, resolve the style to find this property
	 */
        public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	    if (resolve) {
		return ((Css3Style) style).getWhiteSpaceTreatment();
	    } else {
		return ((Css3Style) style).cssWhiteSpaceTreatment;
	    }
	}

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

	/**
	 * Returns the name of this property
	 */
	public String getPropertyName() {
	    return "white-space-treatment";
	}

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

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

	/**
	 * Returns a string representation of the object
	 */
	public String toString() {
	    return wstreat.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 wstreat == ignoreifsurroundinglf;
	}

    }

--- NEW FILE: CssBaselineShift.java ---
//
// $Id: CssBaselineShift.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> baseline || sub || super || &lt;percentage&gt; || &lt;length&gt; || inherit<BR>
 *  <EM>Initial:</EM>baseline<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>refers to the 'line-height' of the element<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'baseline-shift' property allows repositioning of the dominant-baseline
 *  relative to the dominant-baseline. The shifted object might be a sub- or
 *  superscript. Within the shifted object, the whole baseline table is offset;
 *  not just a single baseline. For sub- and superscript, the amount of offset
 *  is determined from the nominal font of the parent.
 */

public class CssBaselineShift extends CssProperty {

    CssValue baselineshift;

    private static CssIdent baseline = new CssIdent("baseline");
    private static CssIdent sub = new CssIdent("sub");
    private static CssIdent sup = new CssIdent("super");
    private static CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssBaselineShift
     */
    public CssBaselineShift() {
	baselineshift = baseline;
    }

    /**
     * Create a new CssBaselineShift
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBaselineShift(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    baselineshift = inherit;
	    expression.next();
	}
	else if (val.equals(baseline)) {
	    baselineshift = baseline;
	    expression.next();
	}
	else if (val.equals(sub)) {
	    baselineshift = sub;
	    expression.next();
	}
	else if (val.equals(sup)) {
	    baselineshift = sup;
	    expression.next();
	}
	else if (val.equals(initial)) {
		baselineshift = initial;
		expression.next();
	}
	else if (val instanceof CssPercentage) {
	    baselineshift = val;
	    expression.next();
	}
	else if (val instanceof CssLength) {
	    baselineshift = val;
	    expression.next();
	}
       	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssBaselineShift(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBaselineShift != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBaselineShift = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBaselineShift();
	}
	else {
	    return ((Css3Style) style).cssBaselineShift;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "baseline-shift";
    }

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

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

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

    /**
     * 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 baselineshift == baseline;
    }

}

--- NEW FILE: CssBorderLeftImage.java ---
//
// $Id: CssBorderLeftImage.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;



public class CssBorderLeftImage extends CssProperty {
    
    String value;
    ApplContext ac;
    CssIdent none = new CssIdent("none");
    
    /**
     * Create new CssBorderLeftImage
     */
    public CssBorderLeftImage() {
	value = "none";
    }
    
    /**
     * Create new CssBorderLeftImage
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderLeftImage(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssIdent) {
	    if (val.equals(none)) {
		value = "none";
		expression.next();
	    } else if (val.equals(inherit)) {
		value = "inherit";
		expression.next();
	    }
	} else if (val instanceof CssURL) {
	    
	    value = val.toString();
	    expression.next();
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		if (val instanceof CssURL) {
		    value += " " + val.toString();
		    expression.next();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
		
		expression.next();
		val = expression.getValue();
		
		if (val != null) {
		    if (val instanceof CssURL) {
			value += " " + val.toString();
			expression.next();
		    } else {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		}
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBorderLeftImage(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderLeftImage != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderLeftImage = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderLeftImage();
	} else {
	    return ((Css3Style) style).cssBorderLeftImage;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderLeftImage &&
		value.equals( ((CssBorderLeftImage) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-left-image";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: CssTextBlink.java ---
//
// $Id: CssTextBlink.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

public class CssTextBlink extends CssProperty {

    CssValue blink;

    static CssIdent none = new CssIdent("none");
    static CssIdent blinkval = new CssIdent("blink");


    /**
     * Create a new CssBlink
     */
    public CssTextBlink() {
	blink = none;
    }

    /**
     * Create a new CssTextBlink
     *
     * @param expression The expression for this parameter
     * @exception InvalidParamException Incorrect value
     */
    public CssTextBlink(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(none)) {
	    blink = none;
	    expression.next();
	}
	else if (val.equals(blinkval)) {
	    blink = blinkval;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    blink = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextBlink(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextBlink != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextBlink = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextBlink();
	}
	else {
	    return ((Css3Style) style).cssTextBlink;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-blink";
    }

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

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

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

    /**
     * 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 blink == none;
    }

}

--- NEW FILE: CssOverflowY.java ---
//
// $Id: CssOverflowY.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYLeft 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyLeft statement at
// http://www.w3.org/Consortium/Legal/copyLeft-software-19980720

package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

public class CssOverflowY extends CssProperty {
    
    CssValue overflowY;
    
    static CssIdent auto = new CssIdent("auto");
    static CssIdent visible = new CssIdent("visible");
    static CssIdent hidden = new CssIdent("hidden");
    static CssIdent scroll = new CssIdent("scroll");
    static CssIdent initial = new CssIdent("initial");
    
    /**
     * Create a new CssOverflowY
     */
    public CssOverflowY() {
	// nothing to do
    }
    
    /**
     * Create a new CssOverflowY
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssOverflowY(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(inherit)) {
	    overflowY = val;
	    expression.next();
	} else if (val.equals(visible)) {
	    overflowY = val;
	    expression.next();
	} else if (val.equals(hidden)) {
	    overflowY = val;
	    expression.next();
	} else if (val.equals(scroll)) {
	    overflowY = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    overflowY = val;
	    expression.next();
	} else if (val.equals(initial)) {
	    overflowY = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssOverflowY(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssOverflowY != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssOverflowY = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getOverflowY();
	}
	else {
	    return ((Css3Style) style).cssOverflowY;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssOverflowY &&
		overflowY.equals(((CssOverflowY) property).overflowY));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "overflow-y";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return overflowY;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return overflowY.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return overflowY.toString();
    }
    
    /**
     * 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 overflowY == visible;
    }
    
}

--- NEW FILE: CssBorderTopLeftFitLength.java ---
//
// $Id: CssBorderTopLeftFitLength.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderTopLeftFitLength extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderTopLeftFitLength
     */
    public CssBorderTopLeftFitLength() {
	value = "overwrite";
    }
    
    /**
     * Create a new CssBorderTopLeftFitLength
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderTopLeftFitLength(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderTopLeftFitLength(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopLeftFitLength != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopLeftFitLength = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopLeftFitLength();
	}
	else {
	    return ((Css3Style) style).cssBorderTopLeftFitLength;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopLeftFitLength &&
		value.equals(((CssBorderTopLeftFitLength) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-left-fit-length";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("overwrite");
    }
    
}

--- NEW FILE: CssBackgroundSpacing.java ---
//
// $Id: CssBackgroundSpacing.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche Smeman (sijtsche@wisdom.nl)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 */

package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;


/**
 */
public class CssBackgroundSpacing extends CssProperty implements CssOperator {
    
    CssValue value;
    CssIdent initial = new CssIdent("initial");
    CssValue second;
    
    /**
     * Create a new CssBackgroundSpacing
     */
    public CssBackgroundSpacing() {
    }
    
    /**
     * Creates a new CssBackgroundSpacing
     *
     * @param expression the expression of the size
     * @exception InvalidParamException The expression is incorrect
     */
    public CssBackgroundSpacing(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();
	setByUser();
	
	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val.equals(initial)) {
	    value = initial;
	} else if (val instanceof CssLength || val instanceof CssNumber) {
	    if (val instanceof CssNumber) {
		val = ((CssNumber) val).getLength();
	    }
	    value = val;
	    expression.next();
	    val = expression.getValue();
	    
	    if (val != null) {
		if (expression.getOperator() == SPACE) {
		    if (val instanceof CssNumber) {
			val = ((CssNumber) val).getLength();
		    }
		    second = val;
		    expression.next();
		} else {
		    // invalid operator
		}
	    }
	} else {
	    throw new InvalidParamException("value",
		    val.toString(),
		    getPropertyName(), ac);
	}
	
	expression.next();
    }
    
    public CssBackgroundSpacing(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the current value
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (second != null) {
	    return value + " " + second;
	} else {
	    return value.toString();
	}
    }
    
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "background-spacing";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBackgroundSpacing != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBackgroundSpacing = this;
    }
    
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getCssBackgroundSpacing();
	}
	else {
	    return ((Css3Style) style).cssBackgroundSpacing;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBackgroundSpacing &&
		value.equals(((CssBackgroundSpacing) property).value));
    }
    
    /**
     * 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 == new CssNumber(0);
    }
    
}

--- NEW FILE: MediaMaxMonochrome.java ---
//
// $Id: MediaMaxMonochrome.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMaxMonochrome.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:04:22  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMaxMonochrome extends CssProperty implements CssOperator {

    CssValue value;

    /**
     * Create a new MediaMaxMonochrome
     */
    public MediaMaxMonochrome() {
		//empty
    }

    /**
     * Create a new MediaMaxMonochrome.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMaxMonochrome(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	char op = SPACE;
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaMaxMonochrome(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "max-monochrome";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMaxMonochrome != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMaxMonochrome = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMaxMonochrome();
	} else {
	    return ((Css3Style) style).mediaMaxMonochrome;
	}
    }

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

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

}

--- NEW FILE: CssBorderImageTransform.java ---
//
// $Id: CssBorderImageTransform.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderImageTransform extends CssProperty {
    
    String value = "";
    
    CssIdent none = new CssIdent("none");
    
    private static String[] values = {
	"none", "rotate", "reflect-xy", "reflect-right", "reflect-left"
    };
    
    /**
     * Create a new CssBorderImageTransform
     */
    public CssBorderImageTransform() {
	value = "none";
    }
    
    /**
     * Create a new CssBorderImageTransform
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderImageTransform(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	val = expression.getValue();
	
	int j = 0;
	for (int i = 0; i < values.length; i++) {
	    if (val.toString().equals(values[j])) {
		value += val.toString() + " ";
		expression.next();
		break;
	    }
	}
	
	if (j == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
    }
    
    public CssBorderImageTransform(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderImageTransform != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderImageTransform = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderImageTransform();
	}
	else {
	    return ((Css3Style) style).cssBorderImageTransform;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderImageTransform &&
		value.equals(((CssBorderImageTransform) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-corner-fit";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("none");
    }
    
}

--- NEW FILE: CssFontEffect.java ---
//
// $Id: CssFontEffect.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || emboss || engrave || outline || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property controls the special effect applied to glyphs.
 *  <PRE>
 *  H1 { font-effect: outline}
 *  </PRE>
 */

public class CssFontEffect extends CssProperty {
 
    CssValue effect;
    ApplContext ac;

    static CssIdent none = new CssIdent("none");
    static CssIdent emboss = new CssIdent("emboss");
    static CssIdent engrave = new CssIdent("engrave");
    static CssIdent outline = new CssIdent("outline");

    /**
     * Create a new CssFontEffect
     */
    public CssFontEffect() {
	effect = none;
    }

    /**
     * Create a new CssFontEffect
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssFontEffect(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(none)) {
	    effect = none;
	    expression.next();
	}
	else if (val.equals(emboss)) {
	    effect = emboss;
	    expression.next();
	}
	else if (val.equals(engrave)) {
	    effect = engrave;
	    expression.next();
	}
	else if (val.equals(outline)) {
	    effect = outline;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    effect = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }

    public CssFontEffect(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssFontEffect != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssFontEffect = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getFontEffect();
	}
	else {
	    return ((Css3Style) style).cssFontEffect;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssFontEffect &&
		effect.equals(((CssFontEffect) property).effect));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "font-effect";
    }

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

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

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

    /**
     * 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 effect == none;
    }

}
			      




    

					       

--- NEW FILE: CssBorderTopLeftRadius.java ---
//
// $Id: CssBorderTopLeftRadius.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssValue;

public class CssBorderTopLeftRadius extends CssProperty {
    
    String value;
    ApplContext ac;
    
    /**
     * Create new CssBorderTopLeftRadius
     */
    public CssBorderTopLeftRadius() {
	CssNumber cssnum =  new CssNumber((float) 1.0);
	value = cssnum.toString();
    }
    
    /**
     * Create new CssBorderTopLeftRadius
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBorderTopLeftRadius(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssLength) {
	    value = val.toString();
	    expression.next();
	    
	    val = expression.getValue();
	    if (val != null) {
		
		if (val instanceof CssLength) {
		    value += " " + val.toString();
		    expression.next();
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBorderTopLeftRadius(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopLeftRadius != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopLeftRadius = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopLeftRadius();
	} else {
	    return ((Css3Style) style).cssBorderTopLeftRadius;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopLeftRadius &&
		value.equals( ((CssBorderTopLeftRadius) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-left-radius";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum.toString();
    }
    
}

--- NEW FILE: CssMarqueeDirection.java ---
//
// $Id: CssMarqueeDirection.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssMarqueeDirection extends CssProperty {

    CssValue mdir;

    static CssIdent auto = new CssIdent("auto");

    private static String[] values = {
		"forwards", "backwards", "ahead", "reverse", 
		"left", "right", "up", "down", "auto", "initial", "inherit"
    };

    /**
     * Create a new CssMarqueeDirection
     */
    public CssMarqueeDirection() {
		mdir = auto;
    }

    /**
     * Create a new CssMarqueeDirection
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssMarqueeDirection(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	
	int i = 0;
	
	for (;i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		mdir = val;
		expression.next();
		break;
	    }
	}
	
	if (i == values.length) {
	    throw new InvalidParamException("value",
		    expression.getValue(),
		    getPropertyName(), ac);
	}
	
    }

    public CssMarqueeDirection(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssMarqueeDirection != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssMarqueeDirection = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMarqueeDirection();
	}
	else {
	    return ((Css3Style) style).cssMarqueeDirection;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "marquee-direction";
    }

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

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

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

    /**
     * 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 mdir == auto;
    }

}

--- NEW FILE: CssBorderLeftFitWidth.java ---
//
// $Id: CssBorderLeftFitWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderLeftFitWidth extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch",
	"overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderLeftFitWidth
     */
    public CssBorderLeftFitWidth() {
	value = "repeat";
    }
    
    /**
     * Create a new CssBorderLeftFitWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderLeftFitWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderLeftFitWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderLeftFitWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderLeftFitWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderLeftFitWidth();
	}
	else {
	    return ((Css3Style) style).cssBorderLeftFitWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderLeftFitWidth &&
		value.equals(((CssBorderLeftFitWidth) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-left-fit-width";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }
    
}

--- NEW FILE: CssNavLeft.java ---
//
// $Id: CssNavLeft.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYLeft 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyLeft statement at
// http://www.w3.org/Consortium/Legal/copyLeft-software-19980720

package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssURL;
import org.w3c.css.values.CssValue;

public class CssNavLeft extends CssProperty {

    CssValue navLeft;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssNavLeft
     */
    public CssNavLeft() {
	// nothing to do
    }

    /**
     * Create a new CssNavLeft
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssNavLeft(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    navLeft = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    navLeft = val;
	    expression.next();
	} else if (val instanceof CssURL) {
	    navLeft = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssNavLeft(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssNavLeft != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssNavLeft = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getNavLeftCSS3();
	}
	else {
	    return ((Css3Style) style).cssNavLeft;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "nav-left";
    }

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

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

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

    /**
     * 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 (navLeft == auto);
    }

}

--- NEW FILE: CssOverflowClip.java ---
//
// $Id: CssOverflowClip.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt; alphavalue&gt; || inherit<BR>
 *  <EM>Initial:</EM>1<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property sets the OverflowClip of an element.
 *  <PRE>
 *  H1 { OverflowClip: 0}
 *  </PRE>
 */

public class CssOverflowClip extends CssProperty implements CssOperator {
    
    String overflowclip = new String();
    ApplContext ac;
    CssIdent auto = new CssIdent("auto");
    CssIdent initial = new CssIdent("initial");
    
    /**
     * Create a new CssOverflowClip
     */
    public CssOverflowClip() {
	
    }
    
    /**
     * Create a new CssOverflowClip
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssOverflowClip(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val instanceof CssFunction) {
	    CssFunction fun = (CssFunction) val;
	    CssExpression params = fun.getParameters();
	    
	    CssValue v;
	    
	    if (fun.getName().equals("rect")) {
		if (params.getCount() == 4) {
		    
		    overflowclip = "rect(";
		    
		    for (int i =0; i < 4; i++) {
			v = params.getValue();
			if (!(v instanceof CssLength || v instanceof CssPercentage) ) {
			    throw new InvalidParamException("value", params.getValue(),
				    getPropertyName(), ac);
			} else {
			    if (i == 0)
				overflowclip += v.toString();
			    else
				overflowclip += ", " + v.toString();
			}
		    }
		    
		} else {
		    throw new InvalidParamException("value", params.getValue(),
			    getPropertyName(), ac);
		}
	    } else if (fun.getName().equals("inset-rect")) {
		
		if (params.getCount() == 4) {
		    
		    overflowclip = "inset-rect(";
		    
		    for (int i =0; i < 4; i++) {
			v = params.getValue();
			if (!(v instanceof CssLength || v instanceof CssPercentage) ) {
			    throw new InvalidParamException("value", params.getValue(),
				    getPropertyName(), ac);
			} else {
			    if (i == 0)
				overflowclip += v.toString();
			    else
				overflowclip += ", " + v.toString();
			}
		    }
		} else {
		    throw new InvalidParamException("value", params.getValue(),
			    getPropertyName(), ac);
		}
		
	    }
	    else throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	    
	    overflowclip += ")";
	    expression.next();
	    return;
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		overflowclip = "inherit";
		expression.next();
	    } else if (val.equals(auto)) {
		overflowclip = "auto";
		expression.next();
	    } else if (val.equals(initial)) {
		overflowclip = "initial";
		expression.next();
	    } else {
		throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssOverflowClip(ApplContext ac, CssExpression expression)
    	throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssOverflowClip != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssOverflowClip = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getOverflowClip();
	} else {
	    return ((Css3Style) style).cssOverflowClip;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssOverflowClip &&
		overflowclip.equals( ((CssOverflowClip) property).overflowclip));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "overflow-clip";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return overflowclip;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return overflowclip.equals("inherit");
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return overflowclip;
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return overflowclip == cssnum.toString();
    }
    
}


--- NEW FILE: CssOverflowCSS3.java ---
//
// $Id: CssOverflowCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 */
public class CssOverflowCSS3 extends CssProperty {

    CssValue value;

    private static CssIdent visible = new CssIdent("visible");
    private static CssIdent hidden = new CssIdent("hidden");
    private static CssIdent scroll = new CssIdent("scroll");
    private static CssIdent auto = new CssIdent("auto");
    private static CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssOverflowCSS3
     */
    public CssOverflowCSS3() {
	value = visible;
    }

    /**
     * Create a new CssOverflowCSS3
     *
     * @param expression The expression for this property
     * @exception InvalidParamException The expression is incorrect
     */
    public CssOverflowCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	} else if (val.equals(visible)) {
	    value = visible;
	    expression.next();
	} else if (val.equals(hidden)) {
	    value = hidden;
	    expression.next();
	} else if (val.equals(visible)) {
	    value = visible;
	    expression.next();
	} else if (val.equals(scroll)) {
	    value = scroll;
	    expression.next();
	} else if (val.equals(auto)) {
	    value = auto;
	    expression.next();
	} else if (val.equals(initial)) {
	    value = initial;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}

    }

    public CssOverflowCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "overflow";
    }

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

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

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssOverflowCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssOverflowCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getOverflowCSS3();
	} else {
	    return ((Css3Style) style).cssOverflowCSS3;
	}
    }

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

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

}

--- NEW FILE: CssMedia.java ---
//
// $Id: CssMedia.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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 java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssOperator;
import org.w3c.css.values.CssValue;


/**
 * This property sets the preferred media for this stylesheet
 */

public class CssMedia extends CssProperty implements CssOperator {

    CssValue value;
    Vector values = new Vector();

    CssIdent all = new CssIdent("all");

    private String[] media = { 
	"all", "aural", "braille", "embossed", "handheld", "print",
	"projection", "screen", "presentation", "tty", "tv" };

    /**
     * Create a new CssMedia
     */
    public CssMedia() {
	value = all;
    }

    /** 
     * Create a new CssMedia
     */
    public CssMedia(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	//setByUser();
	char op = expression.getOperator();
	CssValue val = expression.getValue();
	int counter = 0;
		

	while ((op == COMMA || op == SPACE)
	       && (counter < expression.getCount())) {
	    
	    int i = 0;
	    for (;i < media.length; i++) {
		if (val.toString().equals(media[i])) {
		    break;
		}
	    }
	    
	    if (i == media.length) {
		throw new InvalidParamException("media", expression.getValue(),
						getPropertyName(), ac);
	    }

	    values.addElement(val);
	    expression.next();
	    counter++;
	    val = expression.getValue();
	    op = expression.getOperator();
	}
    }

    public CssMedia(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssMedia != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssMedia = this;

    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMedia();
	} else {
	    return ((Css3Style) style).cssMedia;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return false;
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "media";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (value != null) {
	    return value;
	}
	else {
	    return values;
	}
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * This property can't be inherited, it's only for @preference
     */
    public boolean isSoftlyInherited() {
	return false; 
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (value != null) {
	    return value.toString();
	}
	else {
	    String ret = new String("");
	    for (int i = 0; i < values.size(); i++ ) {
		ret += " " + values.elementAt(i).toString();
	    }
	    return ret;
	}
    }
    
    /**
     * 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 value == all;
    }
    
}


		   




--- NEW FILE: CssBorderFitLength.java ---
//
// $Id: CssBorderFitLength.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderFitLength extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderFitLength
     */
    public CssBorderFitLength() {
	value = "repeat";
    }
    
    /**
     * Create a new CssBorderFitLength
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderFitLength(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (expression.getCount() <= 4) {
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		
		for (; i < expression.getCount(); i++) {
		    
		    int j = 0;
		    for (; j < values.length; j++) {
			if (val.toString().equals(values[j])) {
			    value += val.toString() + " ";
			    expression.next();
			    break;
			}
		    }
		    
		    if (j == values.length) {
			throw new InvalidParamException("value", expression.getValue(),
				getPropertyName(), ac);
		    }
		}
	    }
	    
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
    }
    
    public CssBorderFitLength(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderFitLength != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderFitLength = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderFitLength();
	}
	else {
	    return ((Css3Style) style).cssBorderFitLength;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderFitLength &&
		value.equals(((CssBorderFitLength) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-fit-length";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }
    
}

--- NEW FILE: CssClearAfter.java ---
//
// $Id: CssClearAfter.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssClearAfter extends CssProperty {

    CssValue value;

    static CssIdent none = new CssIdent("none");

    private static String[] values = {
		"none", "left", "right", "top", "bottom", "inside", "outside",
		"start", "end", "both", "initial", "inherit"
    };

    /**
     * Create a new CssClearAfter
     */
    public CssClearAfter() {
	value = none;
    }

    /**
     * Create a new CssClearAfter
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssClearAfter(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		value = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssClearAfter(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssClearAfter != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssClearAfter = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getClearAfter();
	}
	else {
	    return ((Css3Style) style).cssClearAfter;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssClearAfter &&
		value.equals(((CssClearAfter) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "clear-after";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return (value == none);
    }
    
}

--- NEW FILE: CssFontEmphasizeStyle.java ---
//
// $Id: CssFontEmphasizeStyle.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> none || accent || dot || circle || disc || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property sets the style for the emphasis formatting applied to text.
 *  East Asian documents use the following symbols on top of each glyph to 
 *  emphasize a run of text: an 'accent' symbol, a 'dot', a hollow 'circle', or *  a solid 'disc'. 
 *  <PRE>
 *  H1 { font-emphasize: accent}
 *  </PRE>
 */

public class CssFontEmphasizeStyle extends CssProperty {

    CssValue emphstyle;
    ApplContext ac;

    static CssIdent none = new CssIdent("none");
    static CssIdent accent = new CssIdent("accent");
    static CssIdent dot = new CssIdent("dot");
    static CssIdent circle = new CssIdent("circle");
    static CssIdent disc = new CssIdent("disc");

    /**
     * Create a new CssFontEmphasizeStyle
     */
    public CssFontEmphasizeStyle() {
	emphstyle = none;
    }

    /**
     * Create a new CssFontEmphasizeStyle
     * 
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssFontEmphasizeStyle(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(none)) {
	    emphstyle = none;
	    expression.next();
	}
	else if (val.equals(accent)) {
	    emphstyle = accent;
	    expression.next();
	}
	else if (val.equals(dot)) {
	    emphstyle = dot;
	    expression.next();
	}
	else if (val.equals(circle)) {
	    emphstyle = circle;
	    expression.next();
	}
	else if (val.equals(disc)) {
	    emphstyle = disc;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    emphstyle = inherit;
	    expression.next();
	}
	else throw new InvalidParamException("value", expression.getValue(),
					     getPropertyName(), ac);
    }

    public CssFontEmphasizeStyle(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssFontEmphasizeStyle != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssFontEmphasizeStyle = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getFontEmphasizeStyle();
	} else {
	    return ((Css3Style) style).cssFontEmphasizeStyle;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssFontEmphasizeStyle && 
                emphstyle.equals( ((CssFontEmphasizeStyle) property).emphstyle));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "font-emphasize-style";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return emphstyle;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return emphstyle.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return emphstyle.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 emphstyle == none;
    }
    
}	

--- NEW FILE: CssBoxHeight.java ---
//
// $Id: CssBoxHeight.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;length&gt; || &lt;percentage&gt; || auto || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>same as 'width' and 'height'<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssBoxHeight extends CssProperty {

    CssValue boxheight;
    ApplContext ac;

    CssIdent auto = new CssIdent("auto");
    CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssBoxHeight
     */
    public CssBoxHeight() {
	boxheight = auto;
    }

    /**
     * Create a new CssBoxHeight
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssBoxHeight(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(auto)) {
	    boxheight = auto;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    boxheight = inherit;
	    expression.next();
	}
	else if (val.equals(initial)) {
	    boxheight = initial;
	    expression.next();
	}
	else if (val instanceof CssLength) {
	    boxheight = val;
	    expression.next();
	} else if (val instanceof CssPercentage) {
	    boxheight = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssBoxHeight(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBoxHeight != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBoxHeight = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBoxHeight();
	} else {
	    return ((Css3Style) style).cssBoxHeight;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "box-height";
    }

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

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return boxheight.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 boxheight == auto;
    }

}

--- NEW FILE: CssLinefeedTreatment.java ---
//
// $Id: CssLinefeedTreatment.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */

    public class CssLinefeedTreatment extends CssProperty {

	CssValue linefeedtreat;

	private static CssIdent auto = new CssIdent("auto");
	private static CssIdent ignore = new CssIdent("ignore");
	private static CssIdent preserve = new CssIdent("preserve");
	private static CssIdent treatasspace = new CssIdent("treat-as-space");
	private static CssIdent treataszerowidthspace = new CssIdent("treat-as-zero-width-space");
	private static CssIdent ignoreifafterlinefeed = new CssIdent("ignore-if-after-linefeed");


	/**
	 * Create a new CssLinefeedTreatment
	 */
	public CssLinefeedTreatment() {
	    linefeedtreat = treatasspace;
	}

	/**
	 * Create a new CssLinefeedTreatment
	 *
	 *
	 */
	public CssLinefeedTreatment(ApplContext ac, CssExpression expression,
		boolean check) throws InvalidParamException {
	    setByUser();
	    CssValue val = expression.getValue();
	    if (val.equals(auto)) {
		linefeedtreat = auto;
		expression.next();
	    }
	    else if (val.equals(ignore)) {
		linefeedtreat = ignore;
		expression.next();
	    }
	    else if (val.equals(treatasspace)) {
		linefeedtreat = treatasspace;
		expression.next();
	    }
	    else if (val.equals(preserve)) {
		linefeedtreat = preserve;
		expression.next();
	    }
	    else if (val.equals(treataszerowidthspace)) {
		linefeedtreat = treataszerowidthspace;
		expression.next();
	    }
	    else if (val.equals(ignoreifafterlinefeed)) {
		linefeedtreat = ignoreifafterlinefeed;
		expression.next();
	    }
	    else if (val.equals(inherit)) {
		linefeedtreat = inherit;
		expression.next();
	    }
	    
	    else {
		throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	    }
	}
	
	public CssLinefeedTreatment(ApplContext ac, CssExpression expression)
	throws InvalidParamException {
	    this(ac, expression, false);
	}
	
	/**
	 * Add this property to the CssStyle.
	 *
	 * @param style The CssStyle
	 */
	public void addToStyle(ApplContext ac, CssStyle style) {
	    if (((Css3Style) style).cssLinefeedTreatment != null)
		style.addRedefinitionWarning(ac, this);
	    ((Css3Style) style).cssLinefeedTreatment = this;

	}

	/**
	 * Get this property in the style.
	 *
	 * @param style The style where the property is
	 * @param resolve if true, resolve the style to find this property
	 */
        public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	    if (resolve) {
		return ((Css3Style) style).getLinefeedTreatment();
	    } else {
		return ((Css3Style) style).cssLinefeedTreatment;
	    }
	}

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

	/**
	 * Returns the name of this property
	 */
	public String getPropertyName() {
	    return "linefeed-treatment";
	}

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

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

	/**
	 * Returns a string representation of the object
	 */
	public String toString() {
	    return linefeedtreat.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 linefeedtreat == treatasspace;
	}

    }

--- NEW FILE: CssNavDown.java ---
//
// $Id: CssNavDown.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYDown 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyDown statement at
// http://www.w3.org/Consortium/Legal/copyDown-software-19980720

package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssURL;
import org.w3c.css.values.CssValue;

public class CssNavDown extends CssProperty {

    CssValue navDown;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssNavDown
     */
    public CssNavDown() {
	// nothing to do
    }

    /**
     * Create a new CssNavDown
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssNavDown(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    navDown = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    navDown = val;
	    expression.next();
	} else if (val instanceof CssURL) {
	    navDown = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssNavDown(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssNavDown != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssNavDown = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getNavDownCSS3();
	}
	else {
	    return ((Css3Style) style).cssNavDown;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "nav-down";
    }

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

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

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

    /**
     * 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 (navDown == auto);
    }

}

--- NEW FILE: CssTextKashidaSpace.java ---
//
// $Id: CssTextKashidaSpace.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;percentage&gt; || inherit<BR>
 *  <EM>Initial:</EM>0%<BR>
 *  <EM>Applies to:</EM>block-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>as described<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  Kashida is a typographic effect used in Arabic writing systems that allows
 *  character elongation at some carefully chosen points in Arabic. Each 
 *  elongation can be accomplished using a number of kashida glyphs, a single 
 *  graphic or character elongation on each side of the kashida point. (The UA
 *  may use either mechanism based on font or system capability). The 
 *  text-kashida-space property expresses the ratio of the kashida expansion 
 *  size to the white space expansion size, 0% means no kashida expansion, 
 *  100% means kashida expansion only . This property can be used with any
 *  justification style where kashida expansion is used (currently 
 *  text-justify: auto, kashida, distribute and newspaper). 
 */

public class CssTextKashidaSpace extends CssProperty {

    CssValue kashspace;

    /**
     * Create a new CssTextKashidaSpace
     */
    public CssTextKashidaSpace() {
	CssPercentage perc = new CssPercentage(0);
	kashspace = perc;
    }

    /**
     * Create a new CssTextKashidaSpace
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssTextKashidaSpace(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    kashspace = inherit;
	    expression.next();
	}
	else if (val instanceof CssPercentage) {
	    kashspace = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("percentage", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextKashidaSpace(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextKashidaSpace != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextKashidaSpace = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextKashidaSpace();
	}
	else {
	    return ((Css3Style) style).cssTextKashidaSpace;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTextKashidaSpace &&
		kashspace.equals(((CssTextKashidaSpace) property).kashspace));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-kashida-space";
    }

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

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

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

    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssPercentage perc = new CssPercentage(0);
	return kashspace == perc;
    }

}

--- NEW FILE: CssTabIndex.java ---
//
// $Id: CssTabIndex.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || <number> || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all enabled elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:interactive
 *  <P>
 *  This property specifies the position of the current element in the tabbing
 *  order for the current document. 
 */

public class CssTabIndex extends CssProperty {

    CssValue tabidx;
    
    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssTabIndex
     */
    public CssTabIndex() {
	tabidx = auto;
    }

    /**
     * Create a new CssTabIndex
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssTabIndex(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(auto)) {
	    tabidx = auto;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    tabidx = inherit;
	    expression.next();
	}
	else if (val instanceof CssNumber) {
	    tabidx = val;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTabIndex(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTabIndex != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTabIndex = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTabIndex();
	}
	else {
	    return ((Css3Style) style).cssTabIndex;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssTabIndex &&
		tabidx.equals(((CssTabIndex) property).tabidx));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "tab-index";
    }

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

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

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

    /**
     * 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 tabidx == auto;
    }

}

--- NEW FILE: CssVisibilityCSS3.java ---
//
// $Id: CssVisibilityCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 */
public class CssVisibilityCSS3 extends CssProperty {

    CssValue value;

    private static CssIdent visible = new CssIdent("visible");
    private static CssIdent hidden = new CssIdent("hidden");
    private static CssIdent collapse = new CssIdent("collapse");
    private static CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssVisibilityCSS3
     */
    public CssVisibilityCSS3() {
	value = visible;
    }

    /**
     * Create a new CssVisibilityCSS3
     *
     * @param expression The expression for this property
     * @exception InvalidParamException The expression is incorrect
     */
    public CssVisibilityCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	} else if (val.equals(visible)) {
	    value = visible;
	    expression.next();
	} else if (val.equals(hidden)) {
	    value = hidden;
	    expression.next();
	} else if (val.equals(collapse)) {
	    value = collapse;
	    expression.next();
	} else if (val.equals(initial)) {
		value = initial;
		expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}

    }

    public CssVisibilityCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "visibility";
    }

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

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

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssVisibilityCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssVisibilityCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getVisibilityCSS3();
	} else {
	    return ((Css3Style) style).cssVisibilityCSS3;
	}
    }

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

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

}

--- NEW FILE: CssBorderBottomLeftFitWidth.java ---
//
// $Id: CssBorderBottomLeftFitWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderBottomLeftFitWidth extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderBottomLeftFitWidth
     */
    public CssBorderBottomLeftFitWidth() {
	value = "overwrite";
    }
    
    /**
     * Create a new CssBorderBottomLeftFitWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderBottomLeftFitWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderBottomLeftFitWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomLeftFitWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomLeftFitWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomLeftFitWidth();
	}
	else {
	    return ((Css3Style) style).cssBorderBottomLeftFitWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomLeftFitWidth &&
		value.equals(((CssBorderBottomLeftFitWidth) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-left-fit-length";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("overwrite");
    }
    
}

--- NEW FILE: MediaMinColor.java ---
//
// $Id: MediaMinColor.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMinColor.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:02:55  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMinColor extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMinColor
     */
    public MediaMinColor() {
		//empty
    }

    /**
     * Create a new MediaMinColor.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMinColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaMinColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-color";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMinColor != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMinColor = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMinColor();
	} else {
	    return ((Css3Style) style).mediaMinColor;
	}
    }

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

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

}

--- NEW FILE: CssTextUlStyle.java ---
//
// $Id: CssTextUlStyle.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM>  none | solid | double | dotted | thick | dashed | dot-dash | dot-dot-dash | wave | single-accounting | double-accounting | inherit<BR>
 *  <EM>Initial:</EM>solid<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies the underline style to use when 'text-decoration'
 *  is set to 'underline'.
 */

public class CssTextUlStyle extends CssProperty {

    CssValue ulstyle;

    static CssIdent solid = new CssIdent("solid");

    private static String[] values = {
	"none", "solid", "double", "dotted", "thick", "dashed", "dot-dash",
	"dot-dot-dash", "wave", "inherit"
    };

    /**
     * Create a new CssTextUlStyle
     */
    public CssTextUlStyle() {
	ulstyle = solid;
    }

    /**
     * Create a new CssTextUlStyle
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextUlStyle(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	int i = 0;
	for (;i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		ulstyle = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value",
					    expression.getValue(),
					    getPropertyName(), ac);
	}

    }

    public CssTextUlStyle(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextUlStyle != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextUlStyle = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextUlStyle();
	}
	else {
	    return ((Css3Style) style).cssTextUlStyle;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-underline-style";
    }

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

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

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

    /**
     * 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 ulstyle == solid;
    }

}

--- NEW FILE: CssHangingPunctuation.java ---
//
// $Id: CssHangingPunctuation.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */
public class CssHangingPunctuation extends CssProperty {
    
    CssValue hangpunct;
    
    private static CssIdent none = new CssIdent("none");
    private static CssIdent start = new CssIdent("start");
    private static CssIdent end = new CssIdent("end");
    private static CssIdent both = new CssIdent("both");
    
    /**
     * Create a new CssHangingPunctuation
     */
    public CssHangingPunctuation() {
	hangpunct = none;
    }
    
    /**
     * Create a new CssHangingPunctuation
     *
     *
     */
    public CssHangingPunctuation(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(none)) {
	    hangpunct = none;
	    expression.next();
	}
	else if (val.equals(start)) {
	    hangpunct = start;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    hangpunct = inherit;
	    expression.next();
	}
	else if (val.equals(end)) {
	    hangpunct = end;
	    expression.next();
	}
	else if (val.equals(both)) {
	    hangpunct = both;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssHangingPunctuation(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssHangingPunctuation != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssHangingPunctuation = this;
	
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getHangingPunctuation();
	} else {
	    return ((Css3Style) style).cssHangingPunctuation;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssHangingPunctuation &&
		hangpunct.equals( ((CssHangingPunctuation) property).hangpunct));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "hanging-punctuation";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return hangpunct;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return hangpunct.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return hangpunct.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 hangpunct == none;
    }
    
}

--- NEW FILE: CssUserModify.java ---
//
// $Id: CssUserModify.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> read-only || read-write || write-only || inherit<BR>
 *  <EM>Initial:</EM>read-only<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:interactive
 *  <P>
 *  The purpose of this property is to allow finer control over which user 
 *  interface elements are user modifiable. Input elements can be pre-filled 
 *  in, with the user-modify property set to read-only so that the user cannot
 *  change them. This is useful for templates, or for update forms. The user 
 *  can still activate a read-only element and copy content out of
 *  it, if that is appropriate for the content model of the element. 
 *  This is different from making the element "user-input:disabled" because 
 *  that would prevent the user from activating the element.
*/

public class CssUserModify extends CssProperty {

    CssValue um;
    static CssIdent readonly = new CssIdent("read-only");
    static CssIdent readwrite = new CssIdent("read-write");
    static CssIdent writeonly = new CssIdent("write-only");

    /**
     * Create a new CssUserModify
     */
    public CssUserModify() {
	um = readonly;
    }

    /**
     * Create a new CssUserModify
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssUserModify(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(readonly)) {
	    um = readonly;
	    expression.next();
	}
	else if (val.equals(readwrite)) {
	    um = readwrite;
	    expression.next();
	}
	else if (val.equals(writeonly)) {
	    um = writeonly;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    um = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }
    
    public CssUserModify(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssUserModify != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssUserModify = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getUserModify();
	}
	else {
	    return ((Css3Style) style).cssUserModify;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssUserModify &&
		um.equals(((CssUserModify) property).um));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "user-modify";
    }

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

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

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

    /**
     * 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 um == readonly;
    }

}


--- NEW FILE: CssOverflowX.java ---
//
// $Id: CssOverflowX.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYLeft 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyLeft statement at
// http://www.w3.org/Consortium/Legal/copyLeft-software-19980720

package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

public class CssOverflowX extends CssProperty {

    CssValue overflowX;
    
    static CssIdent auto = new CssIdent("auto");
    static CssIdent visible = new CssIdent("visible");
    static CssIdent hidden = new CssIdent("hidden");
    static CssIdent scroll = new CssIdent("scroll");
    static CssIdent initial = new CssIdent("initial");
    
    /**
     * Create a new CssOverflowX
     */
    public CssOverflowX() {
	// nothing to do
    }
    
    /**
     * Create a new CssOverflowX
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssOverflowX(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(inherit)) {
	    overflowX = val;
	    expression.next();
	} else if (val.equals(visible)) {
	    overflowX = val;
	    expression.next();
	} else if (val.equals(hidden)) {
	    overflowX = val;
	    expression.next();
	} else if (val.equals(scroll)) {
	    overflowX = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    overflowX = val;
	    expression.next();
	} else if (val.equals(initial)) {
	    overflowX = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssOverflowX(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssOverflowX != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssOverflowX = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getOverflowX();
	}
	else {
	    return ((Css3Style) style).cssOverflowX;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssOverflowX &&
		overflowX.equals(((CssOverflowX) property).overflowX));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "overflow-x";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return overflowX;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return overflowX.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return overflowX.toString();
    }
    
    /**
     * 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 overflowX == visible;
    }
    
}

--- NEW FILE: CssUserFocus.java ---
//
// $Id: CssUserFocus.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || normal || select-all || select-before ||
 *  select-after || select-same || select-menu || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:interactive
 *  <P>
 *  The purpose of this property is to determine what happens to an element 
 *  when the user focusses it either by "tabbing" into it or clicking on it 
 *  with a pointing device. This property serves as both a shortcut property 
 *  that sets the values of the individual user-focus-key and 
 *  user-focus-pointer properties, and also serves to determine what
 *  happens for any other input methods not covered by user-focus-key 
 *  and user-focus-pointer.
 */

public class CssUserFocus extends CssProperty {

    CssValue userfocus;

    static CssIdent auto = new CssIdent("auto");
    static CssIdent normal = new CssIdent("normal");
    static CssIdent selectall = new CssIdent("select-all");
    static CssIdent selectbefore = new CssIdent("select-before");
    static CssIdent selectafter = new CssIdent("select-after");
    static CssIdent selectsame = new CssIdent("select-same");
    static CssIdent selectmenu = new CssIdent("select-menu");

    /**
     * Create a new CssUserFocus
     */
    public CssUserFocus() {
	userfocus = auto;
    }

    /**
     * Create a new CssUserFocus
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssUserFocus(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(auto)) {
	    userfocus = auto;
	    expression.next();
	}
	else if (val.equals(normal)) {
	    userfocus = normal;
	    expression.next();
	}
	else if (val.equals(selectall)) {
	    userfocus = selectall;
	    expression.next();
	}
	else if (val.equals(selectbefore)) {
	    userfocus = selectbefore;
	    expression.next();
	}
	else if (val.equals(selectafter)) {
	    userfocus = selectafter;
	    expression.next();
	}
	else if (val.equals(selectsame)) {
	    userfocus = selectsame;
	    expression.next();
	}
	else if (val.equals(selectmenu)) {
	    userfocus = selectmenu;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    userfocus = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssUserFocus(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssUserFocus != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssUserFocus = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getUserFocus();
	}
	else {
	    return ((Css3Style) style).cssUserFocus;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssUserFocus &&
		userfocus.equals(((CssUserFocus) property).userfocus));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "user-focus";
    }

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

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

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

    /**
     * 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 userfocus == auto;
    }

}


--- NEW FILE: CssPaddingCSS3.java ---
//
// $Id: CssPaddingCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssPaddingCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/12/24 13:20:53  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:13:58  plehegar
 * Freeze
 *
 * Revision 2.3  1997/08/26 13:57:30  plehegar
 * Added setSelectors
 *
 * Revision 2.2  1997/08/20 11:41:27  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:30  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:14  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:13  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:47:34  plehegar
 * ??
 *
 * Revision 1.1  1997/07/24 01:28:24  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssSelectors;
import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'padding'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> [ &lt;length&gt; | &lt;percentage&gt; ]{1,4} <BR>
 *   <EM>Initial:</EM> 0<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> refer to parent element's width<BR>
 *   <P>
 *   The 'padding' property is a shorthand property for setting 'padding-top',
 *   'padding-right' 'padding-bottom' and 'padding-left' at the same place in
 *   the style sheet.
 *   <P>
 *   If four values are specified they apply to top, right, bottom and left
 *   respectively. If there is only one value, it applies to all sides, if there
 *   are two or three, the missing values are taken from the opposite side.
 *   <P>
 *   The surface of the padding area is set with the 'background' property:
 *   <PRE>
 *   H1 {
 *     background: white;
 *     padding: 1em 2em;
 *   }
 * </PRE>
 *   <P>
 *   The example above sets a '1em' padding vertically ('padding-top' and
 *   'padding-bottom') and a '2em' padding horizontally ('padding-right' and
 *   'padding-left'). The 'em' unit is relative to the element's font size: '1em'
 *   is equal to the size of the font in use.
 *   <P>
 *   Padding values cannot be negative.
 * @version $Revision: 1.1 $
 */
public class CssPaddingCSS3 extends CssProperty implements CssOperator {

    CssPaddingTopCSS3 top;
    CssPaddingBottomCSS3 bottom;
    CssPaddingRightCSS3 right;
    CssPaddingLeftCSS3 left;

    boolean inheritedValue;

    /**
     * Create a new CssPadding
     */
    public CssPaddingCSS3() {
    }

    /**
     * Create a new CssPadding
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssPaddingCSS3(ApplContext ac, CssExpression expression,
	    boolean check)  throws InvalidParamException {
	CssValue val = expression.getValue();
	setByUser();

	if (val.equals(inherit)) {
	    inheritedValue = true;
	    top = new CssPaddingTopCSS3();
	    top.value = inherit;
	    bottom = new CssPaddingBottomCSS3();
	    bottom.value = inherit;
	    right = new CssPaddingRightCSS3();
	    right.value = inherit;
	    left = new CssPaddingLeftCSS3();
	    left.value = inherit;
	}

	switch (expression.getCount()) {
	case 1:
	    top = new CssPaddingTopCSS3(ac, expression);
	    bottom = new CssPaddingBottomCSS3(top);
	    right = new CssPaddingRightCSS3(top);
	    left = new CssPaddingLeftCSS3(top);
	    break;
	case 2:
	    if (expression.getOperator() != SPACE)
		return;
	    top = new CssPaddingTopCSS3(ac, expression);
	    right = new CssPaddingRightCSS3(ac, expression);
	    bottom = new CssPaddingBottomCSS3(top);
	    left = new CssPaddingLeftCSS3(right);
	    break;
	case 3:
	    if (expression.getOperator() != SPACE)
		return;
	    top = new CssPaddingTopCSS3(ac, expression);
	    if (expression.getOperator() != SPACE)
		return;
	    right = new CssPaddingRightCSS3(ac, expression);
	    bottom = new CssPaddingBottomCSS3(ac, expression);
	    left = new CssPaddingLeftCSS3(right);
	    break;
	case 4:
	    if (expression.getOperator() != SPACE)
		return;
	    top = new CssPaddingTopCSS3(ac, expression);
	    if (expression.getOperator() != SPACE)
		return;
	    right = new CssPaddingRightCSS3(ac, expression);
	    if (expression.getOperator() != SPACE)
		return;
	    bottom = new CssPaddingBottomCSS3(ac, expression);
	    left = new CssPaddingLeftCSS3(ac, expression);
	    break;
	default:
	}
    }

    public CssPaddingCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return top;
    }

    /**
     * Returns the top property
     */
    public CssPaddingTopCSS3 getTop() {
	return top;
    }

    /**
     * Returns the right property
     */
    public CssPaddingRightCSS3 getRight() {
	return right;
    }

    /**
     * Returns the bottom property
     */
    public CssPaddingBottomCSS3 getBottom() {
	return bottom;
    }

    /**
     * Returns the left property
     */
    public CssPaddingLeftCSS3 getLeft() {
	return left;
    }

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "padding";
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	if (inheritedValue) {
	    return inherit.toString();
	}
	if (right.value.equals(left.value)) {
	    if (top.value.equals(bottom.value)) {
		if (top.value.equals(right.value)) {
		    return top.toString();
		} else {
		    return top + " " + right;
		}
	    } else {
		return top + " " + right + " " + bottom;
	    }
	} else {
	    return top + " " + right + " " + bottom + " " + left;
	}
    }

    /**
     * Set the context.
     * Overrides this method for a macro
     *
     * @see org.w3c.css.css.CssCascadingOrder#order
     * @see org.w3c.css.css.StyleSheetParser#handleRule
     */
    public void setSelectors(CssSelectors selector) {
	super.setSelectors(selector);
	if (top != null) {
	    top.setSelectors(selector);
	}
	if (right != null) {
	    right.setSelectors(selector);
	}
	if (bottom != null) {
	    bottom.setSelectors(selector);
	}
	if (left != null) {
	    left.setSelectors(selector);
	}
    }

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	top.addToStyle(ac, style);
	right.addToStyle(ac, style);
	bottom.addToStyle(ac, style);
	left.addToStyle(ac, style);
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getPadding();
	} else {
	    return ((Css3Style) style).cssPaddingCSS3;
	}
    }

    /**
     * Update the source file and the line.
     * Overrides this method for a macro
     *
     * @param line The line number where this property is defined
     * @param source The source file where this property is defined
     */
    public void setInfo(int line, String source) {
	super.setInfo(line, source);
	top.setInfo(line, source);
	right.setInfo(line, source);
	bottom.setInfo(line, source);
	left.setInfo(line, source);
    }

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

}

--- NEW FILE: CssBorderBottomFitLength.java ---
//
// $Id: CssBorderBottomFitLength.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderBottomFitLength extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderBottomFitLength
     */
    public CssBorderBottomFitLength() {
	value = "repeat";
    }
    
    /**
     * Create a new CssBorderBottomFitLength
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderBottomFitLength(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderBottomFitLength(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBottomFitLength != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBottomFitLength = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBottomFitLength();
	}
	else {
	    return ((Css3Style) style).cssBorderBottomFitLength;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBottomFitLength &&
		value.equals(((CssBorderBottomFitLength) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-bottom-fit-length";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }
    
}

--- NEW FILE: CssTextLTStyle.java ---
//
// $Id: CssTextLTStyle.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM>  none | solid | double | dotted | thick | dashed | dot-dash | dot-dot-dash | wave | inherit<BR>
 *  <EM>Initial:</EM>solid<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies the line-through style to use when
 *  'text-decoration' is set to 'line-through'.
 */

public class CssTextLTStyle extends CssProperty {

    CssValue ltstyle;

    static CssIdent none = new CssIdent("none");

    private static String[] values = {
	"none", "solid", "double", "dotted", "thick", "dashed", "dot-dash",
	"dot-dot-dash", "wave", "inherit"
    };

    /**
     * Create a new CssTextLTStyle
     */
    public CssTextLTStyle() {
	ltstyle = none;
    }

    /**
     * Create a new CssTextLTStyle
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextLTStyle(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	int i = 0;
	for (;i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		ltstyle = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value",
					    expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextLTStyle(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextLTStyle != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextLTStyle = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextLTStyle();
	}
	else {
	    return ((Css3Style) style).cssTextLTStyle;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-line-through-style";
    }

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

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

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

    /**
     * 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 ltstyle == none;
    }

}

--- NEW FILE: CssBorderTopFitLength.java ---
//
// $Id: CssBorderTopFitLength.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderTopFitLength extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderTopFitLength
     */
    public CssBorderTopFitLength() {
	value = "repeat";
    }
    
    /**
     * Create a new CssBorderTopFitLength
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderTopFitLength(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderTopFitLength(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopFitLength != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopFitLength = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopFitLength();
	}
	else {
	    return ((Css3Style) style).cssBorderTopFitLength;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopFitLength &&
		value.equals(((CssBorderTopFitLength) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-fit-length";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("repeat");
    }
    
}

--- NEW FILE: Css3Style.java ---
//
// $Id: Css3Style.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, 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.parser.CssPrinterStyle;

public class Css3Style extends org.w3c.css.properties.atsc.ATSCStyle {

    CssOpacity cssOpacity;
    CssColorProfile cssColorProfile;
    CssRenderIntent cssRenderIntent;
    CssFontEffect cssFontEffect;
    CssFontSmooth cssFontSmooth;
[...2925 lines suppressed...]
	  }

	  public void findConflicts(ApplContext ac) {
	  if ((cssRubyPosition != null)
	  && (selector != null)
	  && (!isRubyText())) {
	  warnings.addWarning(new Warning(cssRubyPosition,
	  "ruby-text", 1, ac));
	  }

	  if ((cssRubyOverhang != null)
	  && (selector != null)
	  && (!isRubyText())) {
	  warnings.addWarning(new Warning(cssRubyOverhang,
	  "ruby-text", 1, ac));
	  }
	  }
    */

}

--- NEW FILE: CssToggleGroup.java ---
//
// $Id: CssToggleGroup.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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 java.util.Hashtable;
import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> <identifier> || none || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:all
 *  <P>
 *  The 'toggle-group' property accepts the name of a group (identifier). 
 *  The property indicates which toggle group that the element is a member 
 *  of. Only one element belonging to any given toggle group can be :checked. 
 */

public class CssToggleGroup extends CssProperty {

    CssValue toggle;
    public static Hashtable groups = new Hashtable();
    public static String checkedel = new String(); 
    String selector = new String();

    CssIdent none = new CssIdent("none");

    /**
     * Create a new CssToggleGroup
     */
    public CssToggleGroup() {
	toggle = none;
    }

    /**
     * Create a new CssToggleGroup
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssToggleGroup(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(none)) {
	    toggle = none;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    toggle = inherit;
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    if (!groups.containsKey(val.toString())) { // add group + element
		Vector elements = new Vector();
		elements.addElement(selector);
		groups.put(val.toString(), elements);
		toggle = val;
		expression.next();
	    }
	    else { // group already exists, only add element
		Vector elements = new Vector();
	        elements = (Vector) groups.get(val.toString());
		if (!elements.contains(selector)) {
		    groups.remove(val.toString());
		    elements.addElement(selector);
		    groups.put(val.toString(), elements);
		    toggle = val;
		    expression.next();
		}
		toggle = val;
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("groupname", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssToggleGroup(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssToggleGroup != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssToggleGroup = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	selector = ((Css3Style) style).getSelector();
	if (resolve) {
	    return ((Css3Style) style).getToggleGroup();
	} else {
	    return ((Css3Style) style).cssToggleGroup;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssToggleGroup && 
                toggle.equals( ((CssToggleGroup) property).toggle));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "toggle-group";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return toggle;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return toggle.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return toggle.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 toggle == none;
    }
    
}	

--- NEW FILE: CssBackgroundOrigin.java ---
//
// $Id: CssBackgroundOrigin.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche Smeman (sijtsche@wisdom.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> border || padding || content<BR>
 *  <EM>Initial:</EM>border<BR>
 *  <EM>Applies to:</EM>block-level and replaced elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  Determines whether the background extents into the border area or not. If the value is
 *  'padding', the background is clipped to the padding edge and the background of the border
 *  is transparent.
 */

public class CssBackgroundOrigin extends CssProperty {

    CssValue bgorigin;
    
    CssIdent border = new CssIdent("border");
    CssIdent padding = new CssIdent("padding");
    CssIdent content = new CssIdent("content");
    
    /**
     * Create a new CssBackgroundOrigin
     */
    public CssBackgroundOrigin() {
	bgorigin = padding;
    }
    
    /**
     * Create a new CssBackgroundOrigin
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBackgroundOrigin(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(border)) {
	    bgorigin = border;
	    expression.next();
	} else if (val.equals(padding)) {
	    bgorigin = padding;
	    expression.next();
	} else if (val.equals(content)) {
	    bgorigin = content;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssBackgroundOrigin(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }    
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBackgroundOrigin != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBackgroundOrigin = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getCssBackgroundOrigin();
	}
	else {
	    return ((Css3Style) style).cssBackgroundOrigin;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBackgroundOrigin &&
		bgorigin.equals(((CssBackgroundOrigin) property).bgorigin));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "background-origin";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return bgorigin;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return bgorigin.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return bgorigin.toString();
    }
    
    /**
     * 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 bgorigin == padding;
    }
    
}

--- NEW FILE: MediaMaxHeight.java ---
//
// $Id: MediaMaxHeight.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMaxHeight.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:04:22  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMaxHeight extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaMaxHeight
     */
    public MediaMaxHeight() {
		//empty
    }

    /**
     * Create a new MediaMaxHeight.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMaxHeight(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaMaxHeight(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "max-height";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMaxHeight != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMaxHeight = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMaxHeight();
	} else {
	    return ((Css3Style) style).mediaMaxHeight;
	}
    }

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

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

}

--- NEW FILE: CssBorderTopRightFitWidth.java ---
//
// $Id: CssBorderTopRightFitWidth.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderTopRightFitWidth extends CssProperty {
    
    String value = "";
    
    CssIdent repeat = new CssIdent("repeat");
    
    private static String[] values = {
	"clip", "repeat", "scale", "stretch", "overwrite", "overflow", "space"
    };
    
    /**
     * Create a new CssBorderTopRightFitWidth
     */
    public CssBorderTopRightFitWidth() {
	value = "overwrite";
    }
    
    /**
     * Create a new CssBorderTopRightFitWidth
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderTopRightFitWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	int i = 0;
	
	if (val instanceof CssIdent) {
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    value = val.toString();
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
	
	val = expression.getValue();
	i = 0;
	
	if (val != null) {
	    if (val instanceof CssIdent) {
		for (; i < values.length; i++) {
		    if (val.toString().equals(values[i])) {
			value += " " + val.toString();
			expression.next();
			break;
		    }
		}
		if (i == values.length) {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    }
	    else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
    }
    
    public CssBorderTopRightFitWidth(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderTopRightFitWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderTopRightFitWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderTopRightFitWidth();
	}
	else {
	    return ((Css3Style) style).cssBorderTopRightFitWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderTopRightFitWidth &&
		value.equals(((CssBorderTopRightFitWidth) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-top-right-fit-width";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * 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 alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return value.equals("overwrite");
    }

}

--- NEW FILE: MediaHeight.java ---
//
// $Id: MediaHeight.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaHeight.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:05:40  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
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.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaHeight extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaHeight
     */
    public MediaHeight() {
		//empty
    }

    /**
     * Create a new MediaHeight.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaHeight(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssLength || val instanceof CssPercentage) {
		float f = ((Float) val.get()).floatValue();
		if (f < 0) {
		    throw new InvalidParamException("negative-value",
			    val.toString(), ac);
		}
		value = val;
	    } else if (val instanceof CssNumber) {
		value = ((CssNumber) val).getLength();
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaHeight(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "height";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaHeight != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaHeight = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaHeight();
	} else {
	    return ((Css3Style) style).mediaHeight;
	}
    }

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

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

}

--- NEW FILE: CssRubyPosition.java ---
//
// $Id: CssRubyPosition.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> before || after || right || inline || inherit<BR>
 *  <EM>Initial:</EM>before<BR>
 *  <EM>Applies to:</EM>the parent of elements with display: ruby-text<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property is used by the parent of elements with display: ruby-text to
 *  control the position of the ruby text with respect to its base. Such 
 *  parents are typically either the ruby element itself (simple ruby) or 
 *  the rtc element (group ruby).
 */

public class CssRubyPosition extends CssProperty {

    CssValue pos;
    ApplContext ac;

    CssIdent before = new CssIdent("before");
    CssIdent after = new CssIdent("after");
    CssIdent right = new CssIdent("right");
    CssIdent inline = new CssIdent("inline");

    /**
     * Create a new CssRubyPosition
     */
    public CssRubyPosition() {
	pos = before;
    }

    /**
     * Create a new CssRubyPosition
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssRubyPosition(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(before)) {
	    pos = before;
	    expression.next();
	}
	else if (val.equals(after)) {
	    pos = after;
	    expression.next();
	}
	else if (val.equals(right)) {
	    pos = right;
	    expression.next();
	}
	else if (val.equals(inline)) {
	    pos = inline;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    pos = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }
    
    public CssRubyPosition(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
	
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssRubyPosition != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssRubyPosition = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getRubyPosition();
	} else {
	    return ((Css3Style) style).cssRubyPosition;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssRubyPosition && 
                pos.equals( ((CssRubyPosition) property).pos));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "ruby-position";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return pos;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return pos.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return pos.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 pos == before;
    }
    
}	

--- NEW FILE: MediaMonochrome.java ---
//
// $Id: MediaMonochrome.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaMonochrome.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:01:44  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaMonochrome extends CssProperty implements CssOperator {

    CssValue value;

    /**
     * Create a new MediaMonochrome
     */
    public MediaMonochrome() {
		//empty
    }

    /**
     * Create a new MediaMonochrome.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaMonochrome(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	//char op = SPACE;
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }

    public MediaMonochrome(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "monochrome";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaMonochrome != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaMonochrome = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaMonochrome();
	} else {
	    return ((Css3Style) style).mediaMonochrome;
	}
    }

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

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

}

--- NEW FILE: MediaColor.java ---
//
// $Id: MediaColor.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: MediaColor.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2003/01/08 10:05:40  sijtsche
 * new media feature for media queries
 *
 * Revision 1.1  2002/12/24 13:18:36  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:07  plehegar
 * Freeze
 *
 * Revision 2.2  1997/08/20 11:41:30  plehegar
 * Freeze
 *
 * Revision 2.1  1997/08/08 15:52:39  plehegar
 * Nothing
 *
 * Revision 1.4  1997/08/06 17:30:25  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.3  1997/07/30 13:20:23  plehegar
 * Updated package
 *
 * Revision 1.2  1997/07/25 15:44:54  plehegar
 * bug fix in documentation
 *
 * Revision 1.1  1997/07/25 15:42:02  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 * @version $Revision: 1.1 $
 */
public class MediaColor extends CssProperty {

    CssValue value;

    /**
     * Create a new MediaColor
     */
    public MediaColor() {
	//empty
    }

    /**
     * Create a new MediaColor.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MediaColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = null;
	
	if (expression != null) {
	    val = expression.getValue();
	}
	
	setByUser();
	
	if (val != null) {
	    if (val instanceof CssNumber) {
		if (((CssNumber) val).isInteger()) {
		    value = val;
		} else {
		    throw new InvalidParamException("value", expression.getValue(),
			    getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    expression.next();
	}
    }
    
    public MediaColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "color";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.mediaColor != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.mediaColor = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMediaColor();
	} else {
	    return ((Css3Style) style).mediaColor;
	}
    }

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

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

}

--- NEW FILE: CssRubyOverhang.java ---
//
// $Id: CssRubyOverhang.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || start || end || none || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>the parent of elements with display: ruby-text<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssRubyOverhang extends CssProperty {

    CssValue rubyov;
    ApplContext ac;

    CssIdent auto = new CssIdent("auto");
    CssIdent start = new CssIdent("start");
    CssIdent end = new CssIdent("end");
    CssIdent none = new CssIdent("none");

    /**
     * Create a new CssRubyOverhang
     */
    public CssRubyOverhang() {
	rubyov = auto;
    }

    /**
     * Create a new CssRubyOverhang
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssRubyOverhang(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (val.equals(auto)) {
	    rubyov = auto;
	    expression.next();
	}
	else if (val.equals(start)) {
	    rubyov = start;
	    expression.next();
	}
	else if (val.equals(end)) {
	    rubyov = end;
	    expression.next();
	}
	else if (val.equals(none)) {
	    rubyov = end;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    rubyov = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssRubyOverhang(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssRubyOverhang != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssRubyOverhang = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getRubyOverhang();
	} else {
	    return ((Css3Style) style).cssRubyOverhang;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof CssRubyOverhang && 
                rubyov.equals( ((CssRubyOverhang) property).rubyov));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "ruby-overhang";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return rubyov;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return rubyov.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return rubyov.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 rubyov == auto;
    }
    
}	

--- NEW FILE: CssNavRight.java ---
//
// $Id: CssNavRight.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssURL;
import org.w3c.css.values.CssValue;

public class CssNavRight extends CssProperty {

    CssValue navRight;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssNavRight
     */
    public CssNavRight() {
	// nothing to do
    }

    /**
     * Create a new CssNavRight
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssNavRight(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    navRight = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    navRight = val;
	    expression.next();
	} else if (val instanceof CssURL) {
	    navRight = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssNavRight(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssNavRight != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssNavRight = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getNavRightCSS3();
	}
	else {
	    return ((Css3Style) style).cssNavRight;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "nav-right";
    }

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

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

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

    /**
     * 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 (navRight == auto);
    }

}

--- NEW FILE: CssNavUp.java ---
//
// $Id: CssNavUp.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssURL;
import org.w3c.css.values.CssValue;

public class CssNavUp extends CssProperty {

    CssValue navUp;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssNavUp
     */
    public CssNavUp() {
	// nothing to do
    }

    /**
     * Create a new CssNavUp
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssNavUp(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    navUp = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    navUp = val;
	    expression.next();
	} else if (val instanceof CssURL) {
	    navUp = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssNavUp(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssNavUp != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssNavUp = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getNavUpCSS3();
	}
	else {
	    return ((Css3Style) style).cssNavUp;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "nav-up";
    }

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

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

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

    /**
     * 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 (navUp == auto);
    }

}

--- NEW FILE: CssLineStackingRuby.java ---
//
// $Id: CssLineStackingRuby.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *
 */

public class CssLineStackingRuby extends CssProperty {

    CssValue linestackingruby;

    private static CssIdent initial = new CssIdent("initial");
    private static CssIdent excluderuby = new CssIdent("exclude-ruby");
    private static CssIdent includeruby = new CssIdent("include-ruby");

    /**
     * Create a new CssLineStackingRuby
     */
    public CssLineStackingRuby() {
		linestackingruby = excluderuby;
    }

    /**
     * Create a new CssLineStackingRuby
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssLineStackingRuby(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(initial)) {
		linestackingruby = initial;
		expression.next();
	}
	else if (val.equals(excluderuby)) {
		linestackingruby = excluderuby;
		expression.next();
	}
	else if (val.equals(includeruby)) {
		linestackingruby = includeruby;
		expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssLineStackingRuby(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssLineStackingRuby != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssLineStackingRuby = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getLineStackingRuby();
	}
	else {
	    return ((Css3Style) style).cssLineStackingRuby;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "line-stacking-ruby";
    }

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

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

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

    /**
     * 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 linestackingruby == excluderuby;
    }

}

--- NEW FILE: CssBorderBreak.java ---
//
// $Id: CssBorderBreak.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssBorderFaceStyle;
import org.w3c.css.properties.css1.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.CssValue;


public class CssBorderBreak extends CssProperty {

    CssBorderFaceStyle bfsvalue = null;
    CssValue value = null;
    
    CssIdent none = new CssIdent("none");
    
    /**
     * Create a new CssBorderBreak
     */
    public CssBorderBreak() {
	value = none;
    }
    
    /**
     * Create a new CssBorderBreak
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBorderBreak(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	
	bfsvalue = new CssBorderFaceStyle(ac, expression);
    }
    
    public CssBorderBreak(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBorderBreak != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBorderBreak = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBorderBreak();
	}
	else {
	    return ((Css3Style) style).cssBorderBreak;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBorderBreak &&
		(value.equals(((CssBorderBreak) property).value) ||
			bfsvalue.equals(((CssBorderBreak) property).bfsvalue)));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "border-break";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (value != null) {
	    return value.toString();
	} else {
	    return bfsvalue.toString();
	}
    }
    
    /**
     * 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.equals(new CssBorderFaceStyle());
    }
    
}

--- NEW FILE: CssNavIndex.java ---
//
// $Id: CssNavIndex.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssValue;

public class CssNavIndex extends CssProperty {

    CssValue navindex;

    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new CssNavIndex
     */
    public CssNavIndex() {
	// nothing to do
    }

    /**
     * Create a new CssNavIndex
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssNavIndex(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(inherit)) {
	    navindex = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    navindex = val;
	    expression.next();
	} else if (val instanceof CssNumber) {
	    navindex = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }
    
    public CssNavIndex(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }

    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssNavIndex != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssNavIndex = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getNavIndexCSS3();
	}
	else {
	    return ((Css3Style) style).cssNavIndex;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "nav-index";
    }

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

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

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

    /**
     * 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 (navindex == auto);
    }

}

--- NEW FILE: CssPaddingTopCSS3.java ---
//
// $Id: CssPaddingTopCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 * $Log: CssPaddingTopCSS3.java,v $
 * Revision 1.1  2005/08/23 16:24:20  ylafon
 * Patch by Jean-Guilhem Rouel
 *
 * Better handling of media and properties files
 * Major reorganization of those properties files
 *
 * Revision 1.2  2005/08/08 13:18:54  ylafon
 * All those changed made by Jean-Guilhem Rouel:
 *
 * Huge patch, imports fixed (automatic)
 * Bug fixed: 372, 920, 778, 287, 696, 764, 233
 * Partial bug fix for 289
 *
 * Issue with "inherit" in CSS2.
 * The validator now checks the number of values (extraneous values were previously ignored)
 *
 * Revision 1.1  2002/12/24 13:20:53  sijtsche
 * new version for CSS3: value initial added
 *
 * Revision 1.2  2002/04/08 21:17:44  plehegar
 * New
 *
 * Revision 3.1  1997/08/29 13:14:01  plehegar
 * Freeze
 *
 * Revision 1.4  1997/08/20 11:41:27  plehegar
 * Freeze
 *
 * Revision 1.3  1997/08/06 17:30:17  plehegar
 * Updated set, now it's a constructor
 *
 * Revision 1.2  1997/07/30 13:20:17  plehegar
 * Updated package
 *
 * Revision 1.1  1997/07/24 01:32:19  plehegar
 * Initial revision
 *
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'padding-top'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> &lt;length&gt; | &lt;percentage&gt;<BR>
 *   <EM>Initial:</EM> 0<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> no<BR>
 *   <EM>Percentage values:</EM> refer to parent element's width<BR>
 *   <P>
 *   This property sets the top padding of an element.
 *   <PRE>
 *   BLOCKQUOTE { padding-top: 0.3em }
 * </PRE>
 *   <P>
 *   Padding values cannot be negative.
 * @version $Revision: 1.1 $
 */
public class CssPaddingTopCSS3 extends CssPaddingSideCSS3 {
    
    /**
     * Create a new CssPaddingTopCSS3
     */
    public CssPaddingTopCSS3() {
	super();
    }
    
    /**
     * Create a new CssPaddingTopCSS3 with an another CssPaddingSideCSS3.
     *
     * @param another The another side.
     */
    public CssPaddingTopCSS3(CssPaddingSideCSS3 another) {
	super(another);
    }
    
    /**
     * Create a new CssPaddingTopCSS3
     *
     * @param expression The expression for this property.
     * @exception InvalidParamException Values are incorrect
     */
    public CssPaddingTopCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	super(ac, expression, check);
    }
    
    public CssPaddingTopCSS3(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "padding-top";
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssPaddingTopCSS3 != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssPaddingTopCSS3 = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getPaddingTopCSS3();
	} else {
	    return ((Css3Style) style).cssPaddingCSS3.getTop();
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssPaddingTopCSS3 && value.equals(((CssPaddingTopCSS3) property).value));
    }
    
}

--- NEW FILE: CssDisplayModel.java ---
//
// $Id: CssDisplayModel.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> text | flow | svg | math | table | ruby | inherit<BR>
 *  <EM>Initial:</EM>text<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssDisplayModel extends CssProperty {

    CssValue model;

    static CssIdent text = new CssIdent("text");

    private static String[] values = {
		"inline-inside", "block-inside", "table", "ruby",
		"initial", "inherit"
    };

    /**
     * Create a new CssDisplayModel
     */
    public CssDisplayModel() {
	model = text;
    }

    /**
     * Create a new CssDisplayModel
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssDisplayModel(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		model = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssDisplayModel(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssDisplayModel != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssDisplayModel = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getDisplayModel();
	}
	else {
	    return ((Css3Style) style).cssDisplayModel;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "display-model";
    }

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

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

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

    /**
     * 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 (model == text);
    }

}

--- NEW FILE: CssBackgroundQuantity.java ---
//
// $Id: CssBackgroundQuantity.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche Smeman (sijtsche@wisdom.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;integer&gt; || inherit || infinite || initial<BR>
 *  <EM>Initial:</EM>infinite<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  If a 'background-image' is specified, the value of, the value of 'background-quantity'
 *  determines how many times the image will repeat.
 */

public class CssBackgroundQuantity extends CssProperty {

    CssValue bgquantity;
    
    CssIdent initial = new CssIdent("initial");
    CssIdent infinite = new CssIdent("infinite");
    
    /**
     * Create a new CssBackgroundQuantity
     */
    public CssBackgroundQuantity() {
	bgquantity = infinite;
    }
    
    /**
     * Create a new CssBackgroundQuantity
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssBackgroundQuantity(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	CssValue val = expression.getValue();
	setByUser();
	
	if (val.equals(inherit)) {
	    bgquantity = inherit;
	    expression.next();
	    return;
	} else if (val.equals(infinite)) {
	    bgquantity = infinite;
	    expression.next();
	    return;
	} else if (val.equals(initial)) {
	    bgquantity = initial;
	    expression.next();
	    return;
	} else if (val instanceof CssNumber) {
	    if (((CssNumber) val).isInteger()) {
		bgquantity = val;
		expression.next();
		return;
	    } else {
		throw new InvalidParamException("integer",
			val.toString(),
			getPropertyName(), ac);
	    }
	}
	
	throw new InvalidParamException("value",
		val.toString(),
		getPropertyName(), ac);
    }
    
    public CssBackgroundQuantity(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBackgroundQuantity != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBackgroundQuantity = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getCssBackgroundQuantity();
	}
	else {
	    return ((Css3Style) style).cssBackgroundQuantity;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssBackgroundQuantity &&
		bgquantity.equals(((CssBackgroundQuantity) property).bgquantity));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "background-quantity";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return bgquantity;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return bgquantity.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return bgquantity.toString();
    }
    
    /**
     * 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 bgquantity == infinite;
    }
    
}

--- NEW FILE: CssAppearance.java ---
//
// $Id: CssAppearance.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || &lt;percentage&gt; || &lt;length&gt; || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>refers to the 'line-height' of the element<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'alignment-adjust' property allows more precise alignment of
 *  elements, such as graphics, that do not have a baseline-table
 *  or lack the desired baseline in their baseline-table. With the
 *  'alignment-adjust' property, the position of the baseline
 *  identified by the 'alignment-baseline' can be explicitly determined.
 */

public class CssAppearance extends CssProperty {
    
    CssValue appearance;
    
    CssIdent normal = new CssIdent("normal");
    
    private static String[] values = {
	"normal", "icon", "window", "document", "workspace", 
	"desktop", "tooltip", "dialog", "button", "default-button",
	"hyperlink", "menu", "pull-down-menu", "pop-up-menu", "list-menu",
	"field", "inherit"
    };
    
    /**
     * Create a new CssAppearance
     */
    public CssAppearance() {
	appearance = normal;
    }
    
    /**
     * Create a new CssAppearance
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public CssAppearance(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	if(check && expression.getCount() > 1) {
	    throw new InvalidParamException("unrecognize", ac);
	}
	
	setByUser();
	CssValue val = expression.getValue();
	
	if (val instanceof CssIdent) {
	    int i = 0;
	    for (; i < values.length; i++) {
		if (val.toString().equals(values[i])) {
		    appearance = val;
		    expression.next();
		    break;
		}
	    }
	    if (i == values.length) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public CssAppearance(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }  
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssAppearance != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssAppearance = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getAppearance();
	}
	else {
	    return ((Css3Style) style).cssAppearance;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssAppearance &&
		appearance.equals(((CssAppearance) property).appearance));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "appearance";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return appearance;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return appearance.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return appearance.toString();
    }
    
    /**
     * 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 appearance == normal;
    }
    
}

--- NEW FILE: CssMinWidthCSS3.java ---
//
// $Id: CssMinWidthCSS3.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
/*
 */
package org.w3c.css.properties.css3;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssLength;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssPercentage;
import org.w3c.css.values.CssValue;

/**
 */
public class CssMinWidthCSS3 extends CssProperty {

    CssValue value;
    private static CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssMinWidthCSS3
     */
    public CssMinWidthCSS3() {
    }

    /**
     * Create a new CssMinWidthCSS3.
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public CssMinWidthCSS3(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	CssValue val = expression.getValue();

	setByUser();

	if (val.equals(inherit)) {
	    value = inherit;
	} else if (val.equals(initial)) {
		value = initial;
	} else if (val instanceof CssLength || val instanceof CssPercentage) {
	    float f = ((Float) val.get()).floatValue();
	    if (f < 0) {
		throw new InvalidParamException("negative-value",
						val.toString(), ac);
	    }
	    value = val;
	} else if (val instanceof CssNumber) {
	    value = ((CssNumber) val).getLength();
	} else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}

	expression.next();
    }

    public CssMinWidthCSS3(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property.
     */
    public Object get() {
	return value;
    }

    /**
     * Returns the name of this property.
     */
    public String getPropertyName() {
	return "min-width";
    }

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

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


    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	Css3Style style0 = (Css3Style) style;
	if (style0.cssMinWidthCSS3 != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.cssMinWidthCSS3 = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMinWidthCSS3();
	} else {
	    return ((Css3Style) style).cssMinWidthCSS3;
	}
    }

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

}

--- NEW FILE: CssMarquee.java ---
//
// $Id: CssMarquee.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;style&gt; || &lt;color&gt; || &lt;mode&gt; ||
 *  &lt;position&gt; || inherit<BR>
 *  <EM>Initial:</EM>not defined for shorthand properties<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property is the shorthand for 'text-underline-style',
 *  'text-underline-color', 'text-underline-mode' and 'text-underline-position'.
 */

public class CssMarquee extends CssProperty
implements CssOperator  {

    CssValue underline;
    CssMarqueeDirection mdir;
    CssMarqueeRepetition mrep;
    CssMarqueeSpeed mspeed;
    CssMarqueeStyle mstyle;

    /**
     * Create a new CssMarquee
     */
    public CssMarquee() {
    }

    /**
     * Create a new CssMarquee
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssMarquee(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	CssValue val = expression.getValue();
	int maxvalues = 4;
	boolean correct = true;
	char op = SPACE;

	while (correct && (val != null) && (maxvalues-- > 0)) {

	    correct = false;

	    if (mstyle == null) {
		try {
		    mstyle = new CssMarqueeStyle(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && mdir == null) {
		try {
		    mdir = new CssMarqueeDirection(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && mrep == null) {
		try {
		    mrep = new CssMarqueeRepetition(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct && mspeed == null) {
		try {
		    mspeed = new CssMarqueeSpeed(ac, expression);
		    correct = true;
		}
		catch (InvalidParamException e) {
		}
	    }
	    if (!correct) {
		throw new InvalidParamException("value",
						expression.getValue(),
						getPropertyName(), ac);
	    }

	    val = expression.getValue();
	    op = expression.getOperator();
	}

	if (mdir == null) {
	    mdir = new CssMarqueeDirection();
	}
	if (mrep == null) {
	    mrep = new CssMarqueeRepetition();
	}
	if (mspeed == null) {
	    mspeed = new CssMarqueeSpeed();
	}
	if (mstyle == null) {
	    mstyle = new CssMarqueeStyle();
	}

    }

    public CssMarquee(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssMarquee != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssMarquee = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getMarquee();
	}
	else {
	    return ((Css3Style) style).cssMarquee;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "marquee";
    }

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {

	String ret = "";
	if (mstyle.isByUser()) {
	    ret += " " + mstyle;
	}
	if (mdir.isByUser()) {
	    ret += " " + mdir;
	}
	if (mrep.isByUser()) {
	    ret += " " + mrep;
	}
	if (mspeed.isByUser()) {
	    ret += " " + mspeed;
	}
	return ret.substring(1);
    }
}

--- NEW FILE: CssBoxSizing.java ---
//
// $Id: CssBoxSizing.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> content-box || border-box || inherit<BR>
 *  <EM>Initial:</EM>content-box<BR>
 *  <EM>Applies to:</EM>all elements that accept width or height<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class CssBoxSizing extends CssProperty {

    CssValue boxsizing;
    ApplContext ac;

    CssIdent contentbox = new CssIdent("content-box");
    CssIdent borderbox = new CssIdent("border-box");
    CssIdent initial = new CssIdent("initial");

    /**
     * Create a new CssBoxSizing
     */
    public CssBoxSizing() {
	boxsizing = contentbox;
    }

    public CssBoxSizing(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

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

	if (val.equals(contentbox)) {
	    boxsizing = contentbox;
	    expression.next();
	}
	else if (val.equals(borderbox)) {
	    boxsizing = borderbox;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    boxsizing = inherit;
	    expression.next();
	}
	else if (val.equals(initial)) {
	    boxsizing = initial;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssBoxSizing(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssBoxSizing != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssBoxSizing = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getBoxSizing();
	} else {
	    return ((Css3Style) style).cssBoxSizing;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "box-sizing";
    }

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

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

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return boxsizing.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 boxsizing == contentbox;
    }

}

--- NEW FILE: CssTextLTMode.java ---
//
// $Id: CssTextLTMode.java,v 1.1 2005/08/23 16:24:20 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, 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.parser.CssStyle;
import org.w3c.css.properties.css1.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.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM>  continuous || skip-white-space || inherit<BR>
 *  <EM>Initial:</EM>continuous<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property specifies the mode for the line-through, that is whether the
 *  line-through is continuous or whether it appears only under words and not
 *  whitespace.
 */

public class CssTextLTMode extends CssProperty {

    CssValue ltmode;

    static CssIdent continuous = new CssIdent("continuous");
    static CssIdent skipwhitespace = new CssIdent("skip-white-space");

    /**
     * Create a new CssTextLTMode
     */
    public CssTextLTMode() {
	ltmode = continuous;
    }

    /**
     * Create a new CssTextLTMode
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect values
     */
    public CssTextLTMode(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(continuous)) {
	    ltmode = continuous;
	    expression.next();
	}
	else if (val.equals(skipwhitespace)) {
	    ltmode = skipwhitespace;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    ltmode = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value",
					    expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public CssTextLTMode(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((Css3Style) style).cssTextLTMode != null)
	    style.addRedefinitionWarning(ac, this);
	((Css3Style) style).cssTextLTMode = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((Css3Style) style).getTextLTMode();
	}
	else {
	    return ((Css3Style) style).cssTextLTMode;
	}
    }

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

    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-line-through-mode";
    }

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

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

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

    /**
     * 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 ltmode == continuous;
    }

}

Received on Tuesday, 23 August 2005 16:27:57 UTC