- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 25 Sep 2012 19:51:27 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css In directory hutz:/tmp/cvs-serv23779/css Modified Files: CssBorder.java Added Files: CssPadding.java CssPaddingBottom.java CssPaddingLeft.java CssPaddingRight.java CssPaddingTop.java Log Message: padding for CSS1/2/21 and CSS3 Index: CssBorder.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssBorder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorder.java 25 Apr 2012 20:21:53 -0000 1.1 +++ CssBorder.java 25 Sep 2012 19:51:25 -0000 1.2 @@ -36,7 +36,7 @@ public boolean shorthand = false; /** - * Create a new CssBackground + * Create a new CssBorder */ public CssBorder() { } --- NEW FILE: CssPaddingTop.java --- // $Id: CssPaddingTop.java,v 1.1 2012/09/25 19:51:25 ylafon Exp $ // Author: Yves Lafon <ylafon@w3.org> // // (c) COPYRIGHT MIT, ERCIM and Keio University, 2012. // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css; import org.w3c.css.parser.CssStyle; import org.w3c.css.properties.css1.Css1Style; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; import org.w3c.css.values.CssValue; /** * @since CSS1 */ public class CssPaddingTop extends CssProperty { public CssValue value; /** * Create a new CssPaddingTop */ public CssPaddingTop() { } /** * Set the value of the property<br/> * Does not check the number of values * * @param expression The expression for this property * @throws org.w3c.css.util.InvalidParamException * The expression is incorrect */ public CssPaddingTop(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } /** * Set the value of the property * * @param expression The expression for this property * @param check set it to true to check the number of values * @throws org.w3c.css.util.InvalidParamException * The expression is incorrect */ public CssPaddingTop(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { throw new InvalidParamException("unrecognize", ac); } /** * Returns the value of this property */ public Object get() { return value; } /** * Returns the name of this property */ public final String getPropertyName() { return "padding-top"; } /** * 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) { CssPadding cssPadding = ((Css1Style) style).cssPadding; if (cssPadding.paddingTop != null) { style.addRedefinitionWarning(ac, this); } cssPadding.paddingTop = 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 ((Css1Style) style).getPaddingTop(); } else { return ((Css1Style) style).cssPadding.paddingTop; } } /** * Compares two properties for equality. * * @param property The other property. */ public boolean equals(CssProperty property) { try { CssPaddingTop other = (CssPaddingTop) property; return (value != null && value.equals(other.value)) || (value == null && other.value == null); } catch (ClassCastException cce) { return false; // FIXME } } } --- NEW FILE: CssPaddingRight.java --- // $Id: CssPaddingRight.java,v 1.1 2012/09/25 19:51:25 ylafon Exp $ // Author: Yves Lafon <ylafon@w3.org> // // (c) COPYRIGHT MIT, ERCIM and Keio University, 2012. // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css; import org.w3c.css.parser.CssStyle; import org.w3c.css.properties.css1.Css1Style; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; import org.w3c.css.values.CssValue; /** * @since CSS1 */ public class CssPaddingRight extends CssProperty { public CssValue value; /** * Create a new CssPaddingRight */ public CssPaddingRight() { } /** * Set the value of the property<br/> * Does not check the number of values * * @param expression The expression for this property * @throws org.w3c.css.util.InvalidParamException * The expression is incorrect */ public CssPaddingRight(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } /** * Set the value of the property * * @param expression The expression for this property * @param check set it to true to check the number of values * @throws org.w3c.css.util.InvalidParamException * The expression is incorrect */ public CssPaddingRight(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { throw new InvalidParamException("unrecognize", ac); } /** * Returns the value of this property */ public Object get() { return value; } /** * Returns the name of this property */ public final String getPropertyName() { return "padding-right"; } /** * 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) { CssPadding cssPadding = ((Css1Style) style).cssPadding; if (cssPadding.paddingRight != null) { style.addRedefinitionWarning(ac, this); } cssPadding.paddingRight = 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 ((Css1Style) style).getPaddingRight(); } else { return ((Css1Style) style).cssPadding.paddingRight; } } /** * Compares two properties for equality. * * @param property The other property. */ public boolean equals(CssProperty property) { try { CssPaddingRight other = (CssPaddingRight) property; return (value != null && value.equals(other.value)) || (value == null && other.value == null); } catch (ClassCastException cce) { return false; // FIXME } } } --- NEW FILE: CssPaddingBottom.java --- // $Id: CssPaddingBottom.java,v 1.1 2012/09/25 19:51:25 ylafon Exp $ // Author: Yves Lafon <ylafon@w3.org> // // (c) COPYRIGHT MIT, ERCIM and Keio University, 2012. // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css; import org.w3c.css.parser.CssStyle; import org.w3c.css.properties.css1.Css1Style; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; import org.w3c.css.values.CssValue; /** * @since CSS1 */ public class CssPaddingBottom extends CssProperty { public CssValue value; /** * Create a new CssPaddingBottom */ public CssPaddingBottom() { } /** * Set the value of the property<br/> * Does not check the number of values * * @param expression The expression for this property * @throws org.w3c.css.util.InvalidParamException * The expression is incorrect */ public CssPaddingBottom(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } /** * Set the value of the property * * @param expression The expression for this property * @param check set it to true to check the number of values * @throws org.w3c.css.util.InvalidParamException * The expression is incorrect */ public CssPaddingBottom(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { throw new InvalidParamException("unrecognize", ac); } /** * Returns the value of this property */ public Object get() { return value; } /** * Returns the name of this property */ public final String getPropertyName() { return "padding-bottom"; } /** * 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) { CssPadding cssPadding = ((Css1Style) style).cssPadding; if (cssPadding.paddingBottom != null) { style.addRedefinitionWarning(ac, this); } cssPadding.paddingBottom = 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 ((Css1Style) style).getPaddingBottom(); } else { return ((Css1Style) style).cssPadding.paddingBottom; } } /** * Compares two properties for equality. * * @param property The other property. */ public boolean equals(CssProperty property) { try { CssPaddingBottom other = (CssPaddingBottom) property; return (value != null && value.equals(other.value)) || (value == null && other.value == null); } catch (ClassCastException cce) { return false; // FIXME } } } --- NEW FILE: CssPaddingLeft.java --- // $Id: CssPaddingLeft.java,v 1.1 2012/09/25 19:51:25 ylafon Exp $ // Author: Yves Lafon <ylafon@w3.org> // // (c) COPYRIGHT MIT, ERCIM and Keio University, 2012. // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css; import org.w3c.css.parser.CssStyle; import org.w3c.css.properties.css1.Css1Style; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; import org.w3c.css.values.CssValue; /** * @since CSS1 */ public class CssPaddingLeft extends CssProperty { public CssValue value; /** * Create a new CssPaddingLeft */ public CssPaddingLeft() { } /** * Set the value of the property<br/> * Does not check the number of values * * @param expression The expression for this property * @throws org.w3c.css.util.InvalidParamException * The expression is incorrect */ public CssPaddingLeft(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } /** * Set the value of the property * * @param expression The expression for this property * @param check set it to true to check the number of values * @throws org.w3c.css.util.InvalidParamException * The expression is incorrect */ public CssPaddingLeft(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { throw new InvalidParamException("unrecognize", ac); } /** * Returns the value of this property */ public Object get() { return value; } /** * Returns the name of this property */ public final String getPropertyName() { return "padding-left"; } /** * 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) { CssPadding cssPadding = ((Css1Style) style).cssPadding; if (cssPadding.paddingLeft != null) { style.addRedefinitionWarning(ac, this); } cssPadding.paddingLeft = 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 ((Css1Style) style).getPaddingBottom(); } else { return ((Css1Style) style).cssPadding.paddingBottom; } } /** * Compares two properties for equality. * * @param property The other property. */ public boolean equals(CssProperty property) { try { CssPaddingLeft other = (CssPaddingLeft) property; return (value != null && value.equals(other.value)) || (value == null && other.value == null); } catch (ClassCastException cce) { return false; // FIXME } } } --- NEW FILE: CssPadding.java --- // $Id: CssPadding.java,v 1.1 2012/09/25 19:51:25 ylafon Exp $ // Author: Yves Lafon <ylafon@w3.org> // // (c) COPYRIGHT MIT, ERCIM and Keio University, 2012. // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css; import org.w3c.css.parser.CssStyle; import org.w3c.css.properties.css1.Css1Style; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; import org.w3c.css.values.CssValue; /** * @since CSS1 */ public class CssPadding extends CssProperty { public CssValue value; public CssPaddingRight paddingRight; public CssPaddingTop paddingTop; public CssPaddingBottom paddingBottom; public CssPaddingLeft paddingLeft; public boolean shorthand = false; /** * Create a new CssPadding */ public CssPadding() { } /** * Set the value of the property<br/> * Does not check the number of values * * @param expression The expression for this property * @throws org.w3c.css.util.InvalidParamException * The expression is incorrect */ public CssPadding(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } /** * Set the value of the property * * @param expression The expression for this property * @param check set it to true to check the number of values * @throws org.w3c.css.util.InvalidParamException * The expression is incorrect */ public CssPadding(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { throw new InvalidParamException("unrecognize", ac); } /** * Returns the value of this property */ public Object get() { return value; } /** * Returns the name of this property */ public final String getPropertyName() { return "padding"; } /** * 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) { CssPadding cssPadding = ((Css1Style) style).cssPadding; cssPadding.byUser = byUser; cssPadding.shorthand = shorthand; paddingBottom.addToStyle(ac, style); paddingLeft.addToStyle(ac, style); paddingTop.addToStyle(ac, style); paddingRight.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 ((Css1Style) style).getPadding(); } else { return ((Css1Style) style).cssPadding; } } /** * Compares two properties for equality. * * @param property The other property. */ public boolean equals(CssProperty property) { try { CssPadding other = (CssPadding) property; return (value != null && value.equals(other.value)) || (value == null && other.value == null); } catch (ClassCastException cce) { return false; // FIXME } } }
Received on Tuesday, 25 September 2012 19:51:59 UTC