- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 03 Oct 2012 15:11:20 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/values In directory hutz:/tmp/cvs-serv13000/values Modified Files: CssNumber.java Log Message: boundary check Index: CssNumber.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/values/CssNumber.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- CssNumber.java 3 Oct 2012 09:49:18 -0000 1.20 +++ CssNumber.java 3 Oct 2012 15:11:18 -0000 1.21 @@ -299,4 +299,20 @@ ac.getFrame().addWarning("negative", toString()); } } + + /** + * check if the value is positive or null + * + * @param ac the validation context + * @param property the property the value is defined in + * @throws InvalidParamException + */ + public void checkLowerEqualThan(ApplContext ac, double d, CssProperty property) + throws InvalidParamException { + BigDecimal other = BigDecimal.valueOf(d); + if (value.compareTo(other) > 0) { + throw new InvalidParamException("lowerequal", + toString(), other.toPlainString(), ac); + } + } }
Received on Wednesday, 3 October 2012 15:11:28 UTC