W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2009

2002/css-validator/org/w3c/css/selectors TypeSelector.java,1.2,1.3 UniversalSelector.java,1.3,1.4

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 16 Feb 2009 17:53:42 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1LZ7f4-0000Wz-3M@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/selectors
In directory hutz:/tmp/cvs-serv1973/org/w3c/css/selectors

Modified Files:
	TypeSelector.java UniversalSelector.java 
Log Message:
Support for namespaces finished

Index: UniversalSelector.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/selectors/UniversalSelector.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- UniversalSelector.java	16 Sep 2005 13:33:52 -0000	1.3
+++ UniversalSelector.java	16 Feb 2009 17:53:40 -0000	1.4
@@ -10,10 +10,19 @@
  */
 public class UniversalSelector implements Selector {
 
+    String prefix = null;
+
+    public UniversalSelector(String prefix) {
+	this.prefix = prefix;
+    }
+
     /**
      * @see Selector#toString()
      */
     public String toString() {
+	if (prefix != null) {
+	    return prefix+"|*";
+	}
 	return "*";
     }
 

Index: TypeSelector.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/selectors/TypeSelector.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- TypeSelector.java	14 Sep 2005 15:15:32 -0000	1.2
+++ TypeSelector.java	16 Feb 2009 17:53:39 -0000	1.3
@@ -10,14 +10,19 @@
  */
 public class TypeSelector implements Selector {
 
+    String prefix;
     String name;
 
+    public TypeSelector(String prefix, String type) {
+	this.prefix = prefix;
+	this.name = type;
+    }
     /**
      * Creates a new TypeSelector which name name is type
      * @param type the name of this type selector
      */
     public TypeSelector(String type) {
-	this.name = type;
+	this(null, type);
     }
 
     /**
@@ -46,6 +51,12 @@
      * @see Selector#toString()
      */
     public String toString() {
+	if (prefix != null) {
+	    StringBuffer sb = new StringBuffer(prefix);
+	    sb.append('|');
+	    sb.append(name);
+	    return sb.toString();
+	}
 	return name;
     }
 
Received on Monday, 16 February 2009 17:53:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:08 GMT