- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Sun, 23 Oct 2011 19:47:23 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/servlet In directory hutz:/tmp/cvs-serv29185/org/w3c/css/servlet Modified Files: CssValidator.java Log Message: more media check for CSS1, check media set in CSS, not in teh default interface Index: CssValidator.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/servlet/CssValidator.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- CssValidator.java 27 Sep 2011 08:15:46 -0000 1.49 +++ CssValidator.java 23 Oct 2011 19:47:21 -0000 1.50 @@ -19,6 +19,7 @@ import org.w3c.css.index.IndexGenerator; import org.w3c.css.util.ApplContext; import org.w3c.css.util.Codecs; +import org.w3c.css.util.CssVersion; import org.w3c.css.util.FakeFile; import org.w3c.css.util.HTTPURL; import org.w3c.css.util.NVPair; @@ -137,9 +138,9 @@ pval = config.getInitParameter("entitysize"); if (pval != null && !pval.isEmpty()) { try { - Util.maxEntitySize = Long.parseLong(pval); + Util.maxEntitySize = Long.parseLong(pval); } catch (NumberFormatException nfe) { - // the definition was wrong + // the definition was wrong nfe.printStackTrace(); } } @@ -270,6 +271,9 @@ String profile = req.getParameter("profile"); String usermedium = req.getParameter("usermedium"); String type = req.getParameter("type"); + + InputStream in = req.getInputStream(); + if (type == null) type = "none"; @@ -278,13 +282,16 @@ ac.setCredential(credential); } - if (usermedium == null || usermedium.isEmpty()) { - usermedium = "all"; - } - - InputStream in = req.getInputStream(); + // CSS version + ac.setCssVersionAndProfile(profile); - ac.setMedium(usermedium); + // media, only if we are not using CSS1 + if (ac.getCssVersion() != CssVersion.CSS1) { + if (usermedium == null || usermedium.isEmpty()) { + usermedium = "all"; + } + ac.setMedium(usermedium); + } if (req.getParameter("debug") != null) { Util.onDebug = req.getParameter("debug").equals("true"); @@ -302,9 +309,6 @@ output = texthtml; } - // CSS version - ac.setCssVersionAndProfile(profile); - if (Util.onDebug) { System.err.println("[DEBUG] version is : " + ac.getCssVersionString() + " profile is " + ac.getProfileString()
Received on Sunday, 23 October 2011 19:47:25 UTC