- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 21 Oct 2011 01:49:08 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/css In directory hutz:/tmp/cvs-serv28700/org/w3c/css/css Modified Files: CssStyleRule.java StyleSheetParser.java Log Message: redone the Media Features of media queries, up to date per http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/, todo, parsing of media in HTML form Index: CssStyleRule.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/css/CssStyleRule.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- CssStyleRule.java 29 Aug 2011 07:21:00 -0000 1.20 +++ CssStyleRule.java 21 Oct 2011 01:49:06 -0000 1.21 @@ -82,7 +82,7 @@ * * for (int i = 0; i < properties.size() ; i++) { CssProperty property = * (CssProperty)properties.elementAt(i); ret.append("<li>"); - * ret.append(property.getPropertyName()); ret.append(" : <span + * ret.append(property.getFeatureName()); ret.append(" : <span * class='vPropertyValue'>"); ret.append(property.toString()); * ret.append("</span>"); * if (property.getImportant()) { ret.append(" !important"); } Index: StyleSheetParser.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetParser.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- StyleSheetParser.java 29 Aug 2011 07:21:00 -0000 1.18 +++ StyleSheetParser.java 21 Oct 2011 01:49:06 -0000 1.19 @@ -7,8 +7,8 @@ package org.w3c.css.css; +import org.w3c.css.media.AtRuleMedia; import org.w3c.css.parser.AtRule; -import org.w3c.css.parser.AtRuleMedia; import org.w3c.css.parser.AtRulePage; import org.w3c.css.parser.CssError; import org.w3c.css.parser.CssFouffa; @@ -205,7 +205,7 @@ media = ac.getMedium(); } } - AtRuleMedia m = new AtRuleMedia(); + AtRuleMedia m = AtRuleMedia.getInstance(ac.getCssVersion()); try { addMedias(m, media, ac); cssFouffa.setAtRule(m); @@ -225,10 +225,12 @@ } } + // TODO this is not OK for CSS3... + // big FIXME here, we should reuse the parser... private void addMedias(AtRuleMedia m, String medias, ApplContext ac) throws InvalidParamException { StringTokenizer tokens = new StringTokenizer(medias, ","); while (tokens.hasMoreTokens()) { - m.addMedia(tokens.nextToken().trim(), ac); + m.addMedia(null, tokens.nextToken().trim(), ac); } } @@ -266,7 +268,7 @@ media = "all"; } - AtRuleMedia m = new AtRuleMedia(); + AtRuleMedia m = AtRuleMedia.getInstance(ac.getCssVersion()); try { addMedias(m, media, ac); cssFouffa.setAtRule(m); @@ -352,8 +354,8 @@ CssSelectors selector = new CssSelectors(ac); try { - AtRuleMedia media = new AtRuleMedia(); - media.addMedia("all", ac); + AtRuleMedia media = AtRuleMedia.getInstance(ac.getCssVersion()); + media.addMedia(null, "all", ac); cssFouffa.setAtRule(media); } catch (InvalidParamException e) { } //ignore
Received on Friday, 21 October 2011 01:49:44 UTC