- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 12 Feb 2009 10:32:55 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/selectors
In directory hutz:/tmp/cvs-serv630/org/w3c/css/selectors
Modified Files:
PseudoElementSelector.java SelectorsList.java
Added Files:
GeneralSiblingSelector.java
Removed Files:
AdjacentSelector.java
Log Message:
Pseudo Elements and Pseudo Classes are now distinct, and pseudo-elements
are displayed as they should.
General Siblig connectos (CSS3) handled properly.
Index: SelectorsList.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/selectors/SelectorsList.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- SelectorsList.java 20 Mar 2008 12:15:54 -0000 1.4
+++ SelectorsList.java 12 Feb 2009 10:32:53 -0000 1.5
@@ -208,16 +208,26 @@
}
/**
- * Adds an adjacent selector
+ * Adds an adjacent sibling selector
* @param adjacent the adjacent selector to add
* @throws InvalidParamException when trying to add a selector after a pseudo-element
*/
- public void addAdjacent(AdjacentSelector adjacent)
+ public void addAdjacentSibling(AdjacentSiblingSelector adjacent)
throws InvalidParamException {
addSelector(adjacent);
}
/**
+ * Adds an adjacent sibling selector
+ * @param adjacent the adjacent selector to add
+ * @throws InvalidParamException when trying to add a selector after a pseudo-element
+ */
+ public void addGeneralSibling(GeneralSiblingSelector sibling)
+ throws InvalidParamException {
+ addSelector(sibling);
+ }
+
+ /**
* Adds a class selector
* @param cs the class selector to add
* @throws InvalidParamException when trying to add a selector after a pseudo-element
@@ -308,7 +318,7 @@
s.addType(new TypeSelector("F"));
s.addAttribute(new AttributeBegin("lang", "en"));
s.addAttribute(new AttributeAny("bar"));
- s.addAdjacent(new AdjacentSelector());
+ s.addAdjacentSibling(new AdjacentSiblingSelector());
s.addType(new TypeSelector("G"));
s.addId(new IdSelector("id"));
s.addAttribute(new AttributeAny("blop"));
--- AdjacentSelector.java DELETED ---
--- NEW FILE: GeneralSiblingSelector.java ---
// $Id: GeneralSiblingSelector.java,v 1.1 2009/02/12 10:32:52 ylafon Exp $
// (c) COPYRIGHT MIT, ERCIM and Keio, 2009.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.selectors;
/**
* GeneralSibling<br />
*/
public class GeneralSiblingSelector implements Selector {
/**
* @see Selector#toString()
*/
public String toString() {
return " ~ ";
}
/**
* @see Selector#getName()
*/
public String getName() {
return "~";
}
/**
* @see Selector#canApply(Selector)
*/
public boolean canApply(Selector other) {
return false;
}
}
Index: PseudoElementSelector.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/selectors/PseudoElementSelector.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- PseudoElementSelector.java 14 Sep 2005 15:15:32 -0000 1.2
+++ PseudoElementSelector.java 12 Feb 2009 10:32:53 -0000 1.3
@@ -39,7 +39,7 @@
* @see Selector#toString()
*/
public String toString() {
- return ":" + name;
+ return "::" + name;
}
/**
Received on Thursday, 12 February 2009 10:33:03 UTC