- From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 12 Jan 2011 15:01:58 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/parser In directory hutz:/tmp/cvs-serv9051/org/w3c/css/parser Modified Files: CssPropertyFactory.java Log Message: Vendor-specific extensions patch by Cyrille Moureaux Index: CssPropertyFactory.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/CssPropertyFactory.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- CssPropertyFactory.java 5 Jan 2010 13:49:33 -0000 1.24 +++ CssPropertyFactory.java 12 Jan 2011 15:01:56 -0000 1.25 @@ -11,6 +11,7 @@ import org.w3c.css.properties.css.CssProperty; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; +import org.w3c.css.util.WarningParamException; import org.w3c.css.util.Utf8Properties; import org.w3c.css.values.CssExpression; import org.w3c.css.values.CssIdent; @@ -187,6 +188,10 @@ // the property does not exist in this profile // this is an error... or a warning if it exists in another profile if (classname == null) { + if (ac.getTreatVendorExtensionsAsWarnings() && + isVendorExtension(property)) { + throw new WarningParamException("vendor-extension", property); + } ArrayList<String> pfsOk = new ArrayList<String>(); for (int i=0; i<SORTEDPROFILES.length; ++i) { @@ -263,4 +268,9 @@ } return className; } + + private boolean isVendorExtension(String property) { + return property.length() > 0 && + (property.charAt(0) == '-' || property.charAt(0) == '_'); + } }
Received on Wednesday, 12 January 2011 15:02:00 UTC