W3C home > Mailing lists > Public > www-validator-cvs@w3.org > October 2011

2002/css-validator/org/w3c/css/parser CssSelectors.java,1.33,1.34

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 04 Oct 2011 20:04:11 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1RBBDn-0002bU-9I@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/parser
In directory hutz:/tmp/cvs-serv9935/org/w3c/css/parser

Modified Files:
	CssSelectors.java 
Log Message:
updated per http://www.w3.org/TR/2011/REC-css3-selectors-20110929/

Index: CssSelectors.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/CssSelectors.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- CssSelectors.java	17 Sep 2011 06:02:26 -0000	1.33
+++ CssSelectors.java	4 Oct 2011 20:04:09 -0000	1.34
@@ -22,6 +22,7 @@
 import org.w3c.css.selectors.attributes.AttributeExact;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.CssProfile;
+import org.w3c.css.util.CssVersion;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.util.Messages;
 import org.w3c.css.util.Util;
@@ -179,18 +180,19 @@
         // is it a pseudo-class?
         String[] ps = PseudoFactory.getPseudoClass(spec);
         if (ps != null) {
-            for (int i = 0; i < ps.length; i++) {
-                if (pseudo.equals(ps[i])) {
+            for (String p : ps) {
+                if (pseudo.equals(p)) {
                     addPseudoClass(new PseudoClassSelector(pseudo));
                     return;
                 }
             }
         }
+        CssVersion version = ac.getCssVersion();
         // it's not a pseudo-class, maybe one pseudo element exception
-        ps = PseudoFactory.getPseudoElementExceptions(spec);
+        ps = PseudoFactory.getPseudoElementExceptions(version);
         if (ps != null) {
-            for (int i = 0; i < ps.length; i++) {
-                if (pseudo.equals(ps[i])) {
+            for (String p : ps) {
+                if (pseudo.equals(p)) {
                     addPseudoClass(new PseudoClassSelector(pseudo));
                     return;
                 }
@@ -203,10 +205,10 @@
         if (pseudo == null) {
             return;
         }
-        String spec = ac.getPropertyKey();
 
+        CssVersion version = ac.getCssVersion();
         // is it a pseudo-element?
-        String[] ps = PseudoFactory.getPseudoElement(spec);
+        String[] ps = PseudoFactory.getPseudoElement(version);
         if (ps != null) {
             for (String s : ps) {
                 if (pseudo.equals(s)) {
@@ -221,9 +223,9 @@
 
     public void setPseudoFun(String pseudo, String param)
             throws InvalidParamException {
-        String spec = ac.getPropertyKey();
 
-        String[] ps = PseudoFactory.getPseudoFunction(spec);
+        CssVersion version = ac.getCssVersion();
+        String[] ps = PseudoFactory.getPseudoFunction(version);
         if (ps != null) {
             for (String s : ps) {
                 if (pseudo.equals(s)) {
Received on Tuesday, 4 October 2011 20:04:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:47 UTC