- From: CVS User ylafon <cvsmail@w3.org>
- Date: Mon, 11 Feb 2013 15:00:54 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css In directory roscoe:/tmp/cvs-serv14949/properties/css Modified Files: CssFontFamily.java Log Message: inherit should not raise a warning for non-generic families as it can't be known --- /sources/public/2002/css-validator/org/w3c/css/properties/css/CssFontFamily.java 2012/08/30 09:10:56 1.2 +++ /sources/public/2002/css-validator/org/w3c/css/properties/css/CssFontFamily.java 2013/02/11 15:00:54 1.3 @@ -1,4 +1,4 @@ -// $Id: CssFontFamily.java,v 1.2 2012/08/30 09:10:56 ylafon Exp $ +// $Id: CssFontFamily.java,v 1.3 2013/02/11 15:00:54 ylafon Exp $ // Author: Yves Lafon <ylafon@w3.org> // // (c) COPYRIGHT MIT, ERCIM and Keio University, 2012. @@ -13,64 +13,64 @@ import org.w3c.css.values.CssValue; /** + * @version $Revision: 1.3 $ * @since CSS1 - * @version $Revision: 1.2 $ */ public class CssFontFamily extends CssProperty { - public CssValue value; + public CssValue value; public boolean hasGenericFontFamily = false; - /** - * Create a new CssFontFamily - */ - public CssFontFamily() { - } - - /** - * Creates a new CssFontFamily - * - * @param expression The expression for this property - * @throws org.w3c.css.util.InvalidParamException - * Expressions are incorrect - */ - public CssFontFamily(ApplContext ac, CssExpression expression, boolean check) - throws InvalidParamException { - throw new InvalidParamException("value", - expression.getValue().toString(), - getPropertyName(), ac); - } - - public CssFontFamily(ApplContext ac, CssExpression expression) - throws InvalidParamException { - this(ac, expression, false); - } - - /** - * Returns the value of this property - */ - public Object get() { - return value; - } + /** + * Create a new CssFontFamily + */ + public CssFontFamily() { + } + + /** + * Creates a new CssFontFamily + * + * @param expression The expression for this property + * @throws org.w3c.css.util.InvalidParamException + * Expressions are incorrect + */ + public CssFontFamily(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + throw new InvalidParamException("value", + expression.getValue().toString(), + getPropertyName(), ac); + } + + public CssFontFamily(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + /** + * Returns the value of this property + */ + public Object get() { + return value; + } public boolean containsGenericFamily() { return hasGenericFontFamily; } - /** - * Returns the name of this property - */ - public final String getPropertyName() { - return "font-family"; - } - - /** - * Returns true if this property is "softly" inherited - * e.g. his value is equals to inherit - */ - public boolean isSoftlyInherited() { - return value.equals(inherit); - } + /** + * Returns the name of this property + */ + public final String getPropertyName() { + return "font-family"; + } + + /** + * Returns true if this property is "softly" inherited + * e.g. his value is equals to inherit + */ + public boolean isSoftlyInherited() { + return value.equals(inherit); + } /** * Returns a string representation of the object. @@ -79,12 +79,12 @@ return value.toString(); } - /** - * Add this property to the CssStyle. - * - * @param style The CssStyle - */ - public void addToStyle(ApplContext ac, CssStyle style) { + /** + * Add this property to the CssStyle. + * + * @param style The CssStyle + */ + public void addToStyle(ApplContext ac, CssStyle style) { CssFont cssFont = ((Css1Style) style).cssFont; if (cssFont.fontFamily != null) style.addRedefinitionWarning(ac, this); @@ -92,37 +92,38 @@ } - /** - * Compares two properties for equality. - * - * @param property The other property. - */ - public boolean equals(CssProperty property) { - return (property instanceof CssFontFamily && - value.equals(((CssFontFamily) property).value)); - } - - - /** - * 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) { + /** + * Compares two properties for equality. + * + * @param property The other property. + */ + public boolean equals(CssProperty property) { + return (property instanceof CssFontFamily && + value.equals(((CssFontFamily) property).value)); + } + + + /** + * 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).getFontFamily(); } else { return ((Css1Style) style).cssFont.fontFamily; } - } + } /** * Used to check that the value contains a generic font family + * * @return a boolean, true if it contains one */ public boolean hasGenericFamily() { - return hasGenericFontFamily; + return hasGenericFontFamily || (value == inherit); } }
Received on Monday, 11 February 2013 15:00:59 UTC