- From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 12 Dec 2006 05:04:16 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/css In directory hutz:/tmp/cvs-serv19200/org/w3c/css/css Modified Files: XMLStyleSheetHandler.java Log Message: first take on http://www.w3.org/Bugs/Public/show_bug.cgi?id=761 add warning when HTML comments found in stylesheet patch courtesy of Peter Zhelezniakov (SUN Microsystems) Index: XMLStyleSheetHandler.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/css/XMLStyleSheetHandler.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- XMLStyleSheetHandler.java 14 Sep 2005 15:14:18 -0000 1.21 +++ XMLStyleSheetHandler.java 12 Dec 2006 05:04:14 -0000 1.22 @@ -24,6 +24,8 @@ import org.w3c.css.parser.CssError; import org.w3c.css.parser.Errors; +import org.w3c.css.util.Warning; +import org.w3c.css.util.Warnings; import org.w3c.css.util.ApplContext; import org.w3c.css.util.HTTPURL; import org.w3c.css.util.InvalidParamException; @@ -112,6 +114,12 @@ public void comment (char ch[], int start, int length) throws SAXException { if (inStyle) { + int line = (locator != null ? locator.getLineNumber() : -1); + Warning w = new Warning(baseURI.toString(), line, + "style-inside-comment", 0, ac); + Warnings warnings = new Warnings(); + warnings.addWarning(w); + styleSheetParser.notifyWarnings(warnings); text.append(ch, start, length); } }
Received on Tuesday, 12 December 2006 05:04:28 UTC