- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 08 Aug 2005 13:18:06 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/css
In directory hutz:/tmp/cvs-serv27412/org/w3c/css/css
Modified Files:
CssCascadingOrder.java CssParser.java CssRuleList.java
CssStyleRule.java HTMLStyleSheetParser.java NewStyleSheet.java
StyleReport.java StyleReportFactory.java
StyleReportSOAP12.java StyleSheet.java StyleSheetCom.java
StyleSheetGeneratorHTML2.java StyleSheetParser.java
XMLStyleSheetHandler.java html.properties.fr
soap12.properties.en
Log Message:
All those changed made by Jean-Guilhem Rouel:
Huge patch, imports fixed (automatic)
Bug fixed: 372, 920, 778, 287, 696, 764, 233
Partial bug fix for 289
Issue with "inherit" in CSS2.
The validator now checks the number of values (extraneous values were previously ignored)
Index: StyleSheetCom.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetCom.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- StyleSheetCom.java 10 Jan 2004 06:22:24 -0000 1.7
+++ StyleSheetCom.java 8 Aug 2005 13:18:04 -0000 1.8
@@ -6,6 +6,16 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.8 2005/08/08 13:18:04 ylafon
+ * All those changed made by Jean-Guilhem Rouel:
+ *
+ * Huge patch, imports fixed (automatic)
+ * Bug fixed: 372, 920, 778, 287, 696, 764, 233
+ * Partial bug fix for 289
+ *
+ * Issue with "inherit" in CSS2.
+ * The validator now checks the number of values (extraneous values were previously ignored)
+ *
* Revision 1.7 2004/01/10 06:22:24 bjoern
* Fix for http://www.w3.org/Bugs/Public/show_bug.cgi?id=292
*
@@ -30,26 +40,26 @@
*/
package org.w3c.css.css;
+import html.tags.HtmlParser;
+import html.tags.HtmlParserListener;
+import html.tags.HtmlTag;
+import html.tags.HtmlTree;
+
+import java.io.File;
import java.io.IOException;
-import java.io.PrintWriter;
import java.io.OutputStreamWriter;
-import java.io.File;
+import java.io.PrintWriter;
+import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
-import java.net.MalformedURLException;
-import html.tags.HtmlTree;
-import html.tags.HtmlParser;
-import html.tags.HtmlParserListener;
-import html.tags.HtmlTag;
-
-import org.w3c.css.parser.CssSelectors;
import org.w3c.css.parser.CssFouffa;
+import org.w3c.css.parser.CssSelectors;
import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.CssProperty;
+import org.w3c.css.util.ApplContext;
import org.w3c.css.util.HTTPURL;
import org.w3c.css.util.Util;
-import org.w3c.css.util.ApplContext;
/**
* @version $Revision$import javax.servlet.http.HttpServletResponse;
Index: XMLStyleSheetHandler.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/XMLStyleSheetHandler.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- XMLStyleSheetHandler.java 26 Feb 2004 15:23:43 -0000 1.12
+++ XMLStyleSheetHandler.java 8 Aug 2005 13:18:04 -0000 1.13
@@ -13,35 +13,32 @@
*/
package org.w3c.css.css;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.Locator;
-import org.xml.sax.InputSource;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.io.StringBufferInputStream;
import java.io.ByteArrayInputStream;
-import java.io.InputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringBufferInputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.net.URLConnection;
import java.util.Hashtable;
-import org.w3c.css.util.Util;
-import org.w3c.css.util.HTTPURL;
-import org.w3c.css.util.ApplContext;
import org.w3c.css.parser.CssError;
import org.w3c.css.parser.Errors;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.HTTPURL;
import org.w3c.css.util.InvalidParamException;
-
+import org.w3c.css.util.Util;
import org.w3c.css.util.xml.XMLCatalog;
-
import org.w3c.www.mime.MimeType;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.ext.LexicalHandler;
/**
* @version $Revision$
Index: StyleSheetGeneratorHTML2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetGeneratorHTML2.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- StyleSheetGeneratorHTML2.java 12 Jul 2005 14:47:55 -0000 1.13
+++ StyleSheetGeneratorHTML2.java 8 Aug 2005 13:18:04 -0000 1.14
@@ -37,556 +37,556 @@
* @version $Revision$
*/
public final class StyleSheetGeneratorHTML2 extends StyleReport implements
- CssPrinterStyle {
-
+CssPrinterStyle {
+
StyleSheet style;
-
+
Vector items;
[...1013 lines suppressed...]
+ f.close();
+ } catch (Exception e) {
+ System.err.println("org.w3c.css.css.StyleSheetGenerator: "
+ + "couldn't load format properties ");
+ System.err.println(" " + e.toString());
+ }
+
+ availablePropertiesURL = new Utf8Properties();
+ try {
+ url = StyleSheetGenerator.class.getResource("urls.properties");
+ java.io.InputStream f = url.openStream();
+ availablePropertiesURL.load(f);
+ f.close();
+ } catch (Exception e) {
+ System.err.println("org.w3c.css.css.StyleSheetGenerator: "
+ + "couldn't load URLs properties ");
+ System.err.println(" " + e.toString());
+ }
}
}
Index: StyleReportFactory.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleReportFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- StyleReportFactory.java 20 Oct 2003 13:30:06 -0000 1.3
+++ StyleReportFactory.java 8 Aug 2005 13:18:04 -0000 1.4
@@ -5,8 +5,6 @@
package org.w3c.css.css;
-import java.io.PrintWriter;
-
import org.w3c.css.util.ApplContext;
public class StyleReportFactory {
Index: StyleReportSOAP12.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleReportSOAP12.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- StyleReportSOAP12.java 12 Jul 2005 13:45:42 -0000 1.7
+++ StyleReportSOAP12.java 8 Aug 2005 13:18:04 -0000 1.8
@@ -215,7 +215,7 @@
}
}
if (buf.length() != 0) {
- out.print("parse-error</m:errortype>\n\t\t\t<m:context>");
+ out.print("parse-error</m:errortype>\n <m:context>");
out.print(buf);
out.print("</m:context>\n");
}
@@ -225,40 +225,40 @@
}
String name = error.getProperty();
if ((name != null) && (getURLProperty(name) != null)) {
- out.print("\t\t\t<m:property>");
+ out.print(" <m:property>");
out.print(name);
out.print("</m:property>\n");
}
if ((error.getException() != null) && (error.getMessage() != null)) {
if (error.isParseException()) {
- out.print("\t\t\t<m:message>");
+ out.print(" <m:message>");
out.print(queryReplace(error.getMessage()));
out.print("</m:message>\n");
} else {
Exception ex = error.getException();
if (ex instanceof NumberFormatException) {
- out.print("\t\t\t<m:errorsubtype>invalid-number"
+ out.print(" <m:errorsubtype>invalid-number"
+ "</m:error-subtype>\n");
} else {
- out.print("\t\t\t<m:message>");
+ out.print(" <m:message>");
out.print(queryReplace(ex.getMessage()));
out.print("</m:message>\n");
}
}
if (error.getSkippedString() != null) {
- out.print("\t\t\t<m:skippedstring>");
+ out.print(" <m:skippedstring>");
out.print(queryReplace(error.getSkippedString()));
out.print("</m:skippedstring>\n");
} else if (error.getExp() != null) {
- out.print("\t\t\t<m:expression>\n\t\t\t\t<m:start>");
+ out.print(" <m:expression>\n <m:start>");
out.print(queryReplace(error.getExp().toStringFromStart()));
- out.print("</m:start>\n\t\t\t\t<m:end>");
+ out.print("</m:start>\n <m:end>");
out.print(queryReplace(error.getExp().toString()));
- out.print("</m:end>\n\t\t\t</m:expression>\n");
+ out.print("</m:end>\n </m:expression>\n");
}
} else {
- out.print("\t\t\t<m:errorsubtype>unrecognized</m:errorsubtype>\n");
- out.print("\t\t\t<m:skippedstring>");
+ out.print(" <m:errorsubtype>unrecognized</m:errorsubtype>\n");
+ out.print(" <m:skippedstring>");
out.print(queryReplace(error.getSkippedString()));
out.print("</m:skippedstring>\n");
}
@@ -281,56 +281,56 @@
if (!file.equals(oldSourceFile)) {
oldSourceFile = file;
if (open) {
- out.print("</m:errorlist>\n");
+ out.print(" </m:errorlist>\n");
}
- out.print("<m:errorlist>\n");
+ out.print(" <m:errorlist>\n");
open = true;
}
- out.print("\t\t<m:error>\n\t\t\t<m:line>");
+ out.print(" <m:error>\n <m:line>");
out.print(error[i].getLine());
- out.print("</m:line>\n\t\t\t<m:errortype>");
+ out.print("</m:line>\n <m:errortype>");
if (ex instanceof FileNotFoundException) {
out.print("not-found");
- out.print("</m:errortype>\n\t\t\t<m:message>");
+ out.print("</m:errortype>\n <m:message>");
out.print(ex.getMessage());
out.print("</m:message>\n");
} else if (ex instanceof CssParseException) {
produceParseException((CssParseException) ex);
} else if (ex instanceof InvalidParamException) {
out.print("invalid-parameter");
- out.print("</m:errortype>\n\t\t\t<m:message>");
+ out.print("</m:errortype>\n <m:message>");
out.print(queryReplace(ex.getMessage()));
- out.print("\t\t\t</m:message>\n");
+ out.print(" </m:message>\n");
} else if (ex instanceof IOException) {
out.print("IOException</m:errortype>\n");
- out.print("\t\t\t<m:message>");
+ out.print(" <m:message>");
out.print(queryReplace(ex.getMessage()));
- out.print("\t\t\t</m:message>\n");
+ out.print(" </m:message>\n");
} else if (error[i] instanceof CssErrorToken) {
out.print("csserror</m:errortype>");
CssErrorToken terror = (CssErrorToken) error[i];
- out.print("\n\t\t\t\t<m:description>");
+ out.print("\n <m:description>");
out.print(terror.getErrorDescription());
out.print("</m:description>\n");
- out.print("\t\t\t\t<m:skippedstring>");
+ out.print(" <m:skippedstring>");
out.print(terror.getSkippedString());
- out.print("</m:skippedstring>\n");
+ out.print(" </m:skippedstring>\n");
} else {
out.print("uncaught");
- out.print("</m:errortype>\n\t\t\t<m:message>");
+ out.print("</m:errortype>\n <m:message>");
out.print(queryReplace(ex.getMessage()));
out.print("</m:message>\n");
if (ex instanceof NullPointerException) {
// ohoh, a bug
out.print("nullpointer");
- out.print("</m:errortype>\n\t\t\t<m:message>");
+ out.print("</m:errortype>\n <m:message>");
ex.printStackTrace(out);
out.print("</m:message>\n");
}
}
- out.print("\t\t</m:error>\n");
+ out.print(" </m:error>\n");
}
- out.print("\t</m:errorlist>");
+ out.print(" </m:errorlist>");
}
} catch (Exception e) {
out.print("<m:processingerror>");
@@ -359,17 +359,17 @@
if (warn.getLevel() <= warningLevel) {
if (!warn.getSourceFile().equals(oldSourceFile)) {
if (open) {
- out.print("</m:warninglist>\n");
+ out.print(" </m:warninglist>\n");
}
oldSourceFile = warn.getSourceFile();
- out.print("<m:warninglist>\n");
+ out.print(" <m:warninglist>\n");
open = true;
}
if (warn.getLine() != oldLine
|| !warn.getWarningMessage().equals(oldMessage)) {
oldLine = warn.getLine();
oldMessage = warn.getWarningMessage();
- out.print("<m:warning>\n<m:line>");
+ out.print(" <m:warning>\n <m:line>");
out.print(oldLine);
out.print("</m:line>\n");
@@ -377,22 +377,22 @@
// ret.append(" Level : ");
// ret.append(warn.getLevel());
// }
- out.print("<m:level>");
+ out.print(" <m:level>");
out.print(warn.getLevel());
out.print("</m:level>\n");
- // out.print("<message>");
- // out.print(oldMessage);
- // out.print("</message>\n");
+ out.print(" <message>");
+ out.print(oldMessage);
+ out.print("</message>\n");
if (warn.getContext() != null) {
- out.print("<m:context>");
+ out.print(" <m:context>");
out.print(warn.getContext());
out.print("</m:context>\n");
}
- out.print("</m:warning>\n");
+ out.print(" </m:warning>\n");
}
}
}
- out.print("</m:warninglist>");
+ out.print(" </m:warninglist>");
}
} catch (Exception e) {
out.print("<m:processingerror>");
@@ -403,10 +403,10 @@
}
/*
- * Replace all occurences of < and > in a String with
- * their html values: < and >
+ * Replace all occurences of <, >, &, ' and " in a String with
+ * their html values: <, >, &, &aps; and "
* @param s the String with < and >
- * @return the corresponding String with < and > replacing < and >
+ * @return the corresponding String with <, > ... replacing <, > ...
*/
private String queryReplace(String s) {
if (s != null) {
@@ -419,6 +419,12 @@
ret.append("<");
} else if (c == '>') {
ret.append(">");
+ } else if (c == '&') {
+ ret.append("&");
+ } else if (c == '\'') {
+ ret.append("'");
+ } else if (c == '"') {
+ ret.append(""");
} else {
ret.append(c);
}
Index: CssParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/CssParser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssParser.java 2 Jul 2003 14:39:02 -0000 1.3
+++ CssParser.java 8 Aug 2005 13:18:04 -0000 1.4
@@ -6,6 +6,16 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.4 2005/08/08 13:18:04 ylafon
+ * All those changed made by Jean-Guilhem Rouel:
+ *
+ * Huge patch, imports fixed (automatic)
+ * Bug fixed: 372, 920, 778, 287, 696, 764, 233
+ * Partial bug fix for 289
+ *
+ * Issue with "inherit" in CSS2.
+ * The validator now checks the number of values (extraneous values were previously ignored)
+ *
* Revision 1.3 2003/07/02 14:39:02 plehegar
* Removed HttpServletResponse import
*
@@ -15,6 +25,7 @@
*/
package org.w3c.css.css;
+import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
Index: StyleSheetParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetParser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- StyleSheetParser.java 22 Jul 2005 09:45:18 -0000 1.3
+++ StyleSheetParser.java 8 Aug 2005 13:18:04 -0000 1.4
@@ -6,6 +6,16 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.4 2005/08/08 13:18:04 ylafon
+ * All those changed made by Jean-Guilhem Rouel:
+ *
+ * Huge patch, imports fixed (automatic)
+ * Bug fixed: 372, 920, 778, 287, 696, 764, 233
+ * Partial bug fix for 289
+ *
+ * Issue with "inherit" in CSS2.
+ * The validator now checks the number of values (extraneous values were previously ignored)
+ *
* Revision 1.3 2005/07/22 09:45:18 ylafon
* Added code for error Handling (Jean-Guilhem Rouel)
*
@@ -22,30 +32,30 @@
package org.w3c.css.css;
-import java.io.InputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
import java.util.Enumeration;
-import java.util.Vector;
import java.util.StringTokenizer;
-import java.net.URL;
+import java.util.Vector;
+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;
import org.w3c.css.parser.CssParseException;
+import org.w3c.css.parser.CssSelectors;
import org.w3c.css.parser.CssValidatorListener;
-import org.w3c.css.parser.CssFouffa;
import org.w3c.css.parser.Errors;
-import org.w3c.css.parser.CssSelectors;
+import org.w3c.css.parser.analyzer.TokenMgrError;
import org.w3c.css.properties.CssProperty;
-import org.w3c.css.util.Warnings;
-import org.w3c.css.util.Warning;
-import org.w3c.css.util.Util;
import org.w3c.css.util.ApplContext;
-import org.w3c.css.parser.AtRulePage;
-import org.w3c.css.parser.AtRuleMedia;
-import org.w3c.css.parser.AtRule;
-import org.w3c.css.parser.CssError;
-import org.w3c.css.parser.analyzer.TokenMgrError;
import org.w3c.css.util.InvalidParamException;
+import org.w3c.css.util.Util;
+import org.w3c.css.util.Warning;
+import org.w3c.css.util.Warnings;
/**
* @version $Revision$
Index: NewStyleSheet.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/NewStyleSheet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- NewStyleSheet.java 30 May 2004 05:06:51 -0000 1.3
+++ NewStyleSheet.java 8 Aug 2005 13:18:04 -0000 1.4
@@ -8,18 +8,11 @@
package org.w3c.css.css;
-import java.util.Hashtable;
import java.util.Vector;
-import java.util.Enumeration;
+import org.w3c.css.parser.AtRule;
import org.w3c.css.parser.Errors;
import org.w3c.css.util.Warnings;
-import org.w3c.css.parser.AtRule;
-import org.w3c.css.parser.AtRuleMedia;
-import org.w3c.css.parser.AtRuleFontFace;
-import org.w3c.css.parser.AtRulePreference;
-import org.w3c.css.parser.CssSelectors;
-import org.w3c.css.properties.CssProperty;
public class NewStyleSheet {
Index: CssCascadingOrder.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/CssCascadingOrder.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CssCascadingOrder.java 8 Apr 2002 21:16:38 -0000 1.2
+++ CssCascadingOrder.java 8 Aug 2005 13:18:04 -0000 1.3
@@ -6,6 +6,16 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/**
* $Log$
+ * Revision 1.3 2005/08/08 13:18:04 ylafon
+ * All those changed made by Jean-Guilhem Rouel:
+ *
+ * Huge patch, imports fixed (automatic)
+ * Bug fixed: 372, 920, 778, 287, 696, 764, 233
+ * Partial bug fix for 289
+ *
+ * Issue with "inherit" in CSS2.
+ * The validator now checks the number of values (extraneous values were previously ignored)
+ *
* Revision 1.2 2002/04/08 21:16:38 plehegar
* New
*
@@ -28,12 +38,13 @@
package org.w3c.css.css;
import java.util.Enumeration;
+
import org.w3c.css.parser.CssSelectors;
-import org.w3c.css.properties.CssProperty;
import org.w3c.css.parser.CssStyle;
-import org.w3c.css.util.SortAlgorithm;
-import org.w3c.css.util.QuickSortAlgorithm;
+import org.w3c.css.properties.CssProperty;
import org.w3c.css.util.CompareFunction;
+import org.w3c.css.util.QuickSortAlgorithm;
+import org.w3c.css.util.SortAlgorithm;
import org.w3c.css.util.Util;
/**
Index: CssRuleList.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/CssRuleList.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- CssRuleList.java 25 Nov 2004 13:28:41 -0000 1.8
+++ CssRuleList.java 8 Aug 2005 13:18:04 -0000 1.9
@@ -5,127 +5,127 @@
package org.w3c.css.css;
-import java.util.Vector;
import java.io.PrintWriter;
+import java.util.Vector;
import org.w3c.css.parser.AtRule;
import org.w3c.css.util.Util;
public class CssRuleList {
-
+
AtRule atRule;
String atRuleString;
Vector rulelist;
public String pseudopage;
String indent;
-
+
public CssRuleList() {
- atRule = null;
- atRuleString = new String();
- rulelist = new Vector();
- String pseudopage = new String();
- indent = new String();
+ atRule = null;
+ atRuleString = new String();
+ rulelist = new Vector();
+ String pseudopage = new String();
+ indent = new String();
}
-
+
public void addStyleRule(CssStyleRule stylerule) {
- rulelist.addElement(stylerule);
+ rulelist.addElement(stylerule);
}
-
+
public Vector getStyleRules() {
- return rulelist;
+ return rulelist;
}
-
+
public void addAtRule(AtRule atRule) {
- this.atRule = atRule;
- atRuleString = atRule.toString();
+ this.atRule = atRule;
+ atRuleString = atRule.toString();
}
-
+
public String getAtRule() {
- return atRuleString;
+ return atRuleString;
}
-
- public String toString() {
- StringBuffer ret = new StringBuffer();
- if (atRule.isEmpty()) {
- if (null != atRule && !atRuleString.equals("")) {
- ret.append(atRuleString);
- ret.append(' ');
- ret.append('\n');
- }
- } else {
- if (!atRuleString.equals("")) {
- ret.append(atRuleString);
- ret.append(' ');
- ret.append('{');
- ret.append('\n');
- indent = " ";
- }
- for (int i = 0; i < rulelist.size() ; i++ ) {
- ret.append(indent);
- ret.append(((CssStyleRule)rulelist.elementAt(i)).toString());
- }
-
- if (!atRuleString.equals("")) {
- ret.append('}');
- ret.append('\n');
- }
- }
- return ret.toString();
- }
-
-/* public String toHTML() {
- StringBuffer ret = new StringBuffer();
-
- if (null != atRule && atRule.isEmpty()) {
- if (!atRuleString.equals("")) {
- ret.append("<li><span class='atSelector'>");
- ret.append(atRuleString);
- ret.append("</span></li> \n\n");
- }
- } else {
- if (!atRuleString.equals("")) {
- ret.append("<li><span class='atSelector'>");
- ret.append(atRuleString);
- ret.append("</span> {\n<ul>\n");
- }
- for (int i = 0; i < rulelist.size() ; i++ ) {
- ret.append(((CssStyleRule)rulelist.elementAt(i)).toHTML());
- }
-
- if (!atRuleString.equals("")) {
- ret.append("</ul>}</li>\n");
- }
- }
- return ret.toString();
+ public String toString() {
+ StringBuffer ret = new StringBuffer();
+
+ if (atRule.isEmpty()) {
+ if (null != atRule && !atRuleString.equals("")) {
+ ret.append(atRuleString);
+ ret.append(' ');
+ ret.append('\n');
+ }
+ } else {
+ if (!atRuleString.equals("")) {
+ ret.append(atRuleString);
+ ret.append(' ');
+ ret.append('{');
+ ret.append('\n');
+ indent = " ";
+ }
+ for (int i = 0; i < rulelist.size() ; i++ ) {
+ ret.append(indent);
+ ret.append(((CssStyleRule)rulelist.elementAt(i)).toString());
+ }
+
+ if (!atRuleString.equals("")) {
+ ret.append('}');
+ ret.append('\n');
+ }
+ }
+ return ret.toString();
}
-*/
+
+ /* public String toHTML() {
+ StringBuffer ret = new StringBuffer();
+
+ if (null != atRule && atRule.isEmpty()) {
+ if (!atRuleString.equals("")) {
+ ret.append("<li><span class='atSelector'>");
+ ret.append(atRuleString);
+ ret.append("</span></li> \n\n");
+ }
+ } else {
+ if (!atRuleString.equals("")) {
+ ret.append("<li><span class='atSelector'>");
+ ret.append(atRuleString);
+ ret.append("</span> {\n<ul>\n");
+ }
+ for (int i = 0; i < rulelist.size() ; i++ ) {
+ ret.append(((CssStyleRule)rulelist.elementAt(i)).toHTML());
+ }
+
+ if (!atRuleString.equals("")) {
+ ret.append("</ul>}</li>\n");
+ }
+ }
+ return ret.toString();
+ }
+ */
public void toHTML(PrintWriter out) {
- if (null != atRule && atRule.isEmpty()) {
- if (!atRuleString.equals("")) {
- out.print("<li><span class='atSelector'>");
- out.print(Util.escapeHTML(atRuleString));
- out.print("</span></li> \n\n");
- }
- } else {
- if (!atRuleString.equals("")) {
- out.print("<li><span class='atSelector'>");
- out.print(Util.escapeHTML(atRuleString));
- out.print("</span> {\n<ul>\n");
- }
- for (int i = 0; i < rulelist.size() ; i++ ) {
- ((CssStyleRule)rulelist.elementAt(i)).toHTML(out);
- }
-
- if (!atRuleString.equals("")) {
- out.print("</ul>}</li>\n");
- }
- }
+ if (null != atRule && atRule.isEmpty()) {
+ if (!atRuleString.equals("")) {
+ out.print("<li><span class='atSelector'>");
+ out.print(Util.escapeHTML(atRuleString));
+ out.print("</span></li> \n\n");
+ }
+ } else {
+ if (!atRuleString.equals("")) {
+ out.print("<li><span class='atSelector'>");
+ out.print(Util.escapeHTML(atRuleString));
+ out.print("</span> {\n<ul>\n");
+ }
+ for (int i = 0; i < rulelist.size() ; i++ ) {
+ ((CssStyleRule)rulelist.elementAt(i)).toHTML(out);
+ }
+
+ if (!atRuleString.equals("")) {
+ out.print("</ul>}</li>\n");
+ }
+ }
}
-
+
public void clear() {
- atRuleString = "";
- rulelist.removeAllElements();
- pseudopage = "";
+ atRuleString = "";
+ rulelist.removeAllElements();
+ pseudopage = "";
}
}
Index: soap12.properties.en
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/soap12.properties.en,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- soap12.properties.en 22 Jul 2005 09:45:18 -0000 1.6
+++ soap12.properties.en 8 Aug 2005 13:18:04 -0000 1.7
@@ -30,22 +30,22 @@
\ \ <env:Body>\n\
\ \ \ \ <m:cssvalidationresponse \n\
\ \ \ \ \ \ \ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding" \n\
-\ \ \ \ \ \ \ xmlns:m="http://www.w3.org/2005/07/css-validator"> \n\
-\ \ \ \ \ <m:uri><!-- #file-title --></m:uri> \n\
-\ \ \ \ \ <m:checkedby>http://jigsaw.w3.org/css-validator/</m:checkedby>\n\
-\ \ \ \ \ <m:csslevel><!-- #cssversion --></m:csslevel>\n\
-\ \ \ \ \ <m:date><!-- #currentdate --></m:date>\n\
-\ \ \ \ \ <m:validity><!-- #isvalid --></m:validity>\n\
-\ \ \ \ \ <m:result>\n\
-\ \ \ \ \ \ <m:errors>\n\
-\ \ \ \ \ \ \ \ <m:errorcount><!-- #errors-count --></m:errorcount>\n\
-\ \ \ \ \ \ \ \ <!-- #error -->\n\
-\ \ \ \ \ \ </m:errors>\n\
-\ \ \ \ \ \ <m:warnings>\n\
-\ \ \ \ \ \ \ \ <m:warningcount><!-- #warnings-count --></m:warningcount>\n\
-\ \ \ \ \ \ \ \ <!-- #warning -->\n\
-\ \ \ \ \ \ </m:warnings>\n\
-\ \ \ \ \ </m:result>\n\
+\ \ \ \ \ \ \ xmlns:m="http://www.w3.org/2003/10/20-css-validator"> \n\
+\ \ \ \ \ \ <m:uri><!-- #file-title --></m:uri> \n\
+\ \ \ \ \ \ <m:checkedby>http://jigsaw.w3.org/css-validator/</m:checkedby>\n\
+\ \ \ \ \ \ <m:csslevel><!-- #cssversion --></m:csslevel>\n\
+\ \ \ \ \ \ <m:date><!-- #currentdate --></m:date>\n\
+\ \ \ \ \ \ <m:validity><!-- #isvalid --></m:validity>\n\
+\ \ \ \ \ \ <m:result>\n\
+\ \ \ \ \ \ \ \ <m:errors>\n\
+\ \ \ \ \ \ \ \ \ \ <m:errorcount><!-- #errors-count --></m:errorcount>\n\
+<!-- #error -->\n\
+\ \ \ \ \ \ \ \ </m:errors>\n\
+\ \ \ \ \ \ \ \ <m:warnings>\n\
+\ \ \ \ \ \ \ \ \ \ <m:warningcount><!-- #warnings-count --></m:warningcount>\n\
+<!-- #warning -->\n\
+\ \ \ \ \ \ \ \ </m:warnings>\n\
+\ \ \ \ \ \ </m:result>\n\
\ \ \ \ </m:cssvalidationresponse>\n\
\ \ </env:Body>\n\
</env:Envelope>
Index: StyleReport.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleReport.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- StyleReport.java 17 Oct 2003 13:54:02 -0000 1.1
+++ StyleReport.java 8 Aug 2005 13:18:04 -0000 1.2
@@ -7,8 +7,6 @@
import java.io.PrintWriter;
-import org.w3c.css.util.ApplContext;
-
public abstract class StyleReport {
abstract public void print(PrintWriter out);
Index: StyleSheet.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleSheet.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- StyleSheet.java 30 May 2004 05:06:51 -0000 1.6
+++ StyleSheet.java 8 Aug 2005 13:18:04 -0000 1.7
@@ -12,18 +12,15 @@
import java.util.Hashtable;
import java.util.Vector;
-import org.w3c.css.util.Warnings;
-import org.w3c.css.util.Util;
-import org.w3c.css.util.SortedHashtable;
-import org.w3c.css.util.ApplContext;
-import org.w3c.css.parser.Errors;
-import org.w3c.css.parser.CssStyle;
import org.w3c.css.parser.AtRule;
-import org.w3c.css.parser.AtRuleMedia;
-import org.w3c.css.parser.AtRuleFontFace;
-import org.w3c.css.parser.AtRulePreference;
import org.w3c.css.parser.CssSelectors;
+import org.w3c.css.parser.CssStyle;
+import org.w3c.css.parser.Errors;
import org.w3c.css.properties.CssProperty;
+import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.SortedHashtable;
+import org.w3c.css.util.Util;
+import org.w3c.css.util.Warnings;
/**
* This class contains a style sheet with all rules, errors and warnings.
Index: CssStyleRule.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/CssStyleRule.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- CssStyleRule.java 25 Nov 2004 13:24:50 -0000 1.6
+++ CssStyleRule.java 8 Aug 2005 13:18:04 -0000 1.7
@@ -5,102 +5,104 @@
package org.w3c.css.css;
-import java.util.Vector;
import java.io.PrintWriter;
+import java.util.Vector;
-import org.w3c.css.util.Util;
import org.w3c.css.properties.CssProperty;
+import org.w3c.css.util.Util;
public class CssStyleRule {
-
+
public CssStyleRule(String indent, String selectors,
- Vector properties, boolean important) {
- this.selectors = selectors;
- this.properties = properties;
- this.important = important;
- this.indent = indent;
+ Vector properties, boolean important) {
+ this.selectors = selectors;
+ this.properties = properties;
+ this.important = important;
+ this.indent = indent;
}
-
+
public String toString() {
- StringBuffer ret = new StringBuffer();
- if (selectors != null) {
- ret.append(selectors);
- ret.append(' ');
- ret.append('{');
- ret.append('\n');
- }
-
- for (int i = 0; i < properties.size() ; i++) {
- CssProperty property = (CssProperty)properties.elementAt(i);
- ret.append(indent);
- ret.append(" ");
- ret.append(property.getPropertyName());
- ret.append(" : ");
- ret.append(property.toString());
- if (property.getImportant()) {
- ret.append(" important");
- }
- ret.append(';');
- ret.append('\n');
- }
- if (selectors != null) {
- ret.append(indent);
- ret.append('}');
- ret.append('\n');
- ret.append('\n');
- }
- return ret.toString();
- }
-/*
- public String toHTML() {
- StringBuffer ret = new StringBuffer("<li><span class='selector'>");
- if (selectors != null) {
- ret.append(selectors);
- ret.append("</span> {<ul class='vRule'>\n");
- }
-
- for (int i = 0; i < properties.size() ; i++) {
- CssProperty property = (CssProperty)properties.elementAt(i);
- ret.append("<li>");
- ret.append(property.getPropertyName());
- ret.append(" : <span class='vPropertyValue'>");
- ret.append(property.toString());
- ret.append("</span>");
- if (property.getImportant()) {
- ret.append(" !important");
- }
- ret.append(";</li>\n");
- }
- ret.append("</ul>}</li>\n\n");
- return ret.toString();
+ StringBuffer ret = new StringBuffer();
+ if (selectors != null) {
+ ret.append(selectors);
+ ret.append(' ');
+ ret.append('{');
+ ret.append('\n');
+ }
+
+ for (int i = 0; i < properties.size() ; i++) {
+ CssProperty property = (CssProperty)properties.elementAt(i);
+ ret.append(indent);
+ ret.append(" ");
+ ret.append(property.getPropertyName());
+ ret.append(" : ");
+ ret.append(property.toString());
+ if (property.getImportant()) {
+ ret.append(" important");
+ }
+ ret.append(';');
+ ret.append('\n');
+ }
+ if (selectors != null) {
+ ret.append(indent);
+ ret.append('}');
+ ret.append('\n');
+ ret.append('\n');
+ }
+ return ret.toString();
}
-*/
+ /*
+ public String toHTML() {
+ StringBuffer ret = new StringBuffer("<li><span class='selector'>");
+ if (selectors != null) {
+ ret.append(selectors);
+ ret.append("</span> {<ul class='vRule'>\n");
+ }
+
+ for (int i = 0; i < properties.size() ; i++) {
+ CssProperty property = (CssProperty)properties.elementAt(i);
+ ret.append("<li>");
+ ret.append(property.getPropertyName());
+ ret.append(" : <span class='vPropertyValue'>");
+ ret.append(property.toString());
+ ret.append("</span>");
+ if (property.getImportant()) {
+ ret.append(" !important");
+ }
+ ret.append(";</li>\n");
+ }
+ ret.append("</ul>}</li>\n\n");
+ return ret.toString();
+ }
+ */
public void toHTML(PrintWriter out) {
- out.print("<li><span class='selector'>");
- if (selectors != null) {
- out.print(selectors);
- out.print("</span> {<ul class='vRule'>\n");
- }
-
- for (int i = 0; i < properties.size() ; i++) {
- CssProperty property = (CssProperty)properties.elementAt(i);
- out.print("<li>");
- out.print(Util.escapeHTML(property.getPropertyName()));
- out.print(" : <span class='vPropertyValue'>");
- out.print(Util.escapeHTML(property.toString()));
- out.print("</span>");
- if (property.getImportant()) {
- out.print(" !important");
- }
- out.print(";</li>\n");
- }
- out.print("</ul>}</li>\n\n");
+ if(properties != null) {
+ out.print("<li><span class='selector'>");
+ if (selectors != null) {
+ out.print(selectors);
+ out.print("</span> {<ul class='vRule'>\n");
+ }
+
+ for (int i = 0; i < properties.size() ; i++) {
+ CssProperty property = (CssProperty)properties.elementAt(i);
+ out.print("<li>");
+ out.print(Util.escapeHTML(property.getPropertyName()));
+ out.print(" : <span class='vPropertyValue'>");
+ out.print(Util.escapeHTML(property.toString()));
+ out.print("</span>");
+ if (property.getImportant()) {
+ out.print(" !important");
+ }
+ out.print(";</li>\n");
+ }
+ out.print("</ul>}</li>\n\n");
+ }
}
private String indent;
private String selectors;
private Vector properties;
private boolean important;
-
+
}
Index: HTMLStyleSheetParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/HTMLStyleSheetParser.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- HTMLStyleSheetParser.java 6 May 2004 12:48:42 -0000 1.13
+++ HTMLStyleSheetParser.java 8 Aug 2005 13:18:04 -0000 1.14
@@ -7,22 +7,19 @@
package org.w3c.css.css;
+import html.tags.HtmlParser;
+import html.tags.HtmlParserListener;
+import html.tags.HtmlTag;
+import html.tags.HtmlTree;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-// import org.w3c.www.protocol.http.HttpURLConnection;
-import html.tags.HtmlTree;
-import html.tags.HtmlParser;
-import html.tags.HtmlParserListener;
-import html.tags.HtmlTag;
-
-import org.w3c.css.util.Util;
-import org.w3c.css.util.HTTPURL;
import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.HTTPURL;
+import org.w3c.css.util.Util;
/**
* @version $Revision$
Index: html.properties.fr
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/html.properties.fr,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- html.properties.fr 12 Jul 2005 15:28:54 -0000 1.5
+++ html.properties.fr 8 Aug 2005 13:18:04 -0000 1.6
@@ -65,11 +65,11 @@
rules: \
<div id="css">\n\
-<h2>Votre feuille de style CSS validée :</h2> \
-<ul class='vAtRule'> \
-<!-- #charset-rule --> \
-<!-- #rule --> \
-</ul> \
+<h2>Votre feuille de style CSS validée :</h2> \n\
+<ul class='vAtRule'> \n\
+<!-- #charset-rule --> \n\
+<!-- #rule --> \n\
+</ul> \n\
</div>
charset-rule: \
@@ -123,7 +123,7 @@
<!-- #errors -->\n\
<!-- #warnings -->\n\
<!-- #rules -->\n\
-<!-- #no-rules -->\
+<!-- #no-rules -->\n\
<hr /> \n\
<p><a class="right" href="http://jigsaw.w3.org/css-validator/">\
<img src="http://jigsaw.w3.org/css-validator/images/vcss" \
Received on Monday, 8 August 2005 13:20:28 UTC