- 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/analyzer In directory hutz:/tmp/cvs-serv9051/org/w3c/css/parser/analyzer Modified Files: CssParserTokenManager.java CssParser.java ParseException.java CssParser.jj Log Message: Vendor-specific extensions patch by Cyrille Moureaux Index: CssParserTokenManager.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParserTokenManager.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- CssParserTokenManager.java 5 Jan 2010 13:55:49 -0000 1.35 +++ CssParserTokenManager.java 12 Jan 2011 15:01:56 -0000 1.36 @@ -36,6 +36,7 @@ import org.w3c.css.parser.AtRulePhoneticAlphabet; import org.w3c.css.properties.svg.AtRuleColorProfile; import org.w3c.css.util.InvalidParamException; +import org.w3c.css.util.WarningParamException; import org.w3c.css.util.Util; import org.w3c.css.util.Messages; import org.w3c.css.css.StyleSheetCom; Index: CssParser.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- CssParser.java 5 Jan 2010 13:55:48 -0000 1.70 +++ CssParser.java 12 Jan 2011 15:01:56 -0000 1.71 @@ -38,6 +38,7 @@ import org.w3c.css.parser.AtRulePhoneticAlphabet; import org.w3c.css.properties.svg.AtRuleColorProfile; import org.w3c.css.util.InvalidParamException; +import org.w3c.css.util.WarningParamException; import org.w3c.css.util.Util; import org.w3c.css.util.Messages; import org.w3c.css.css.StyleSheetCom; @@ -168,14 +169,15 @@ public void ReInitWithAc(InputStream stream, ApplContext ac, String charset) { + InputStream is = /*new CommentSkipperInputStream(stream);*/stream; if (charset == null) { charset = "iso-8859-1"; } InputStreamReader isr = null; try { - isr = new InputStreamReader(stream, charset); + isr = new InputStreamReader(is, charset); } catch (UnsupportedEncodingException uex) { - isr = new InputStreamReader(stream); + isr = new InputStreamReader(is); } // reinit, it can not happen... // ...in theory ;) @@ -3074,9 +3076,16 @@ } } } catch (InvalidParamException e) { - incompatible_error = false; + incompatible_error = false; + if (e instanceof WarningParamException) { + WarningParamException warningException = + (WarningParamException) e; + ac.getFrame().addWarning(warningException.getMessage(), + warningException.getMessageArgs()); + } else { values.starts(); addError(e, (CssExpression) values); + } } {if (true) return null;} } catch (NumberFormatException e) { @@ -3735,21 +3744,21 @@ finally { jj_save(0, xla); } } - private boolean jj_3R_86() { + private boolean jj_3_1() { Token xsp; xsp = jj_scanpos; - if (jj_scan_token(34)) { - jj_scanpos = xsp; - if (jj_scan_token(47)) return true; - } + if (jj_3R_86()) jj_scanpos = xsp; + if (jj_scan_token(98)) return true; return false; } - private boolean jj_3_1() { + private boolean jj_3R_86() { Token xsp; xsp = jj_scanpos; - if (jj_3R_86()) jj_scanpos = xsp; - if (jj_scan_token(98)) return true; + if (jj_scan_token(34)) { + jj_scanpos = xsp; + if (jj_scan_token(47)) return true; + } return false; } Index: ParseException.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/ParseException.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ParseException.java 5 Jan 2010 13:55:49 -0000 1.8 +++ ParseException.java 12 Jan 2011 15:01:56 -0000 1.9 @@ -173,8 +173,7 @@ default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u"); - retval.append(s.substring(s.length() - 4, s.length())); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } Index: CssParser.jj =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- CssParser.jj 5 Jan 2010 13:55:48 -0000 1.71 +++ CssParser.jj 12 Jan 2011 15:01:56 -0000 1.72 @@ -58,6 +58,7 @@ import org.w3c.css.parser.AtRulePhoneticAlphabet; import org.w3c.css.properties.svg.AtRuleColorProfile; import org.w3c.css.util.InvalidParamException; +import org.w3c.css.util.WarningParamException; import org.w3c.css.util.Util; import org.w3c.css.util.Messages; import org.w3c.css.css.StyleSheetCom; @@ -1991,11 +1992,18 @@ } } } catch (InvalidParamException e) { - incompatible_error = false; - values.starts(); - addError(e, (CssExpression) values); - } - return null; + incompatible_error = false; + if (e instanceof WarningParamException) { + WarningParamException warningException = + (WarningParamException) e; + ac.getFrame().addWarning(warningException.getMessage(), + warningException.getMessageArgs()); + } else { + values.starts(); + addError(e, (CssExpression) values); + } + } + return null; } } catch (NumberFormatException e) { skipAfterExpression(e);
Received on Wednesday, 12 January 2011 15:02:00 UTC