- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 10 Oct 2012 13:58:33 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer In directory hutz:/tmp/cvs-serv1625 Modified Files: CssParser.jj Log Message: checking keyframes selector values Index: CssParser.jj =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- CssParser.jj 10 Oct 2012 07:51:50 -0000 1.86 +++ CssParser.jj 10 Oct 2012 13:58:31 -0000 1.87 @@ -1136,12 +1136,23 @@ { CssSelectors selector = new CssSelectors(ac, next); selector.setAtRule(getAtRule()); Token n; + Token op = null; } { try { ( n=<IDENT> { - selector.addType(new TypeSelector(convertIdent(n.image))); - } | n=<PERCENTAGE> { + CssIdent ident = new CssIdent(); + ident.set(convertIdent(n.image), ac); + AtRuleKeyframes.checkSelectorValue(ident, ac); + selector.addType(new TypeSelector(ident.toString())); + } | ( op=<PLUS> | op="-" )? n=<PERCENTAGE> { + CssPercentage p = new CssPercentage(); + if (op == null) { + p.set(n.image, ac); + } else { + p.set(op.image+n.image, ac); + } + AtRuleKeyframes.checkSelectorValue(p, ac); selector.addType(new TypeSelector(n.image)); } ) ( <S> )* { @@ -1220,25 +1231,27 @@ } )* <LBRACE> ( <S> )* v=declarations() <RBRACE> ( <S> )* { validSelector = (sl.size() != 0); - if (v == null) { - ac.getFrame().addWarning("no-declaration"); - } else { - boolean first = true; - for (CssSelectors _s : sl) { - if (first) { - handleRule(_s, v); - first = false; - } else { - ArrayList<CssProperty> vcopy = new ArrayList<CssProperty>(v.size()); - for (CssProperty p : v) { - vcopy.add(p.duplicate()); - } - handleRule(_s, vcopy); + if (validSelector) { + if (v == null) { + ac.getFrame().addWarning("no-declaration"); + } else { + boolean first = true; + for (CssSelectors _s : sl) { + if (first) { + handleRule(_s, v); + first = false; + } else { + ArrayList<CssProperty> vcopy = new ArrayList<CssProperty>(v.size()); + for (CssProperty p : v) { + vcopy.add(p.duplicate()); + } + handleRule(_s, vcopy); + } } } + setSelectorList(sl); + endOfRule(); } - setSelectorList(sl); - endOfRule(); } )* <RBRACE> ( <S> )* { endOfAtRule(); @@ -2261,6 +2274,7 @@ ( ( <PLUS> { operator = '+' ; } | <MINUS> { operator = '-'; } | n=<NUMBER> { setValue(new CssNumber(), exp, operator, n, NUMBER); } + | n=<PERCENTAGE> { setValue(new CssPercentage(), exp, operator, n, PERCENTAGE); } // FIXME dimen should be a CssDimension() | n=<DIMEN> { setValue(new CssIdent(), exp, operator, n, IDENT); } | n=<STRING> { setValue(new CssString(), exp, operator, n, STRING); }
Received on Wednesday, 10 October 2012 13:58:34 UTC