- From: CVS User ylafon <cvsmail@w3.org>
- Date: Wed, 13 Feb 2013 14:54:29 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/parser
In directory roscoe:/tmp/cvs-serv9845/parser
Modified Files:
CssSelectors.java
Log Message:
pseudo elements/classes should behave as properties, wrt vendor extensions (see https://www.w3.org/Bugs/Public/show_bug.cgi?id=20787)
--- /sources/public/2002/css-validator/org/w3c/css/parser/CssSelectors.java 2012/10/10 07:46:33 1.37
+++ /sources/public/2002/css-validator/org/w3c/css/parser/CssSelectors.java 2013/02/13 14:54:29 1.38
@@ -1,5 +1,5 @@
//
-// $Id: CssSelectors.java,v 1.37 2012/10/10 07:46:33 ylafon Exp $
+// $Id: CssSelectors.java,v 1.38 2013/02/13 14:54:29 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
@@ -38,7 +38,7 @@
* Invoke a <code>set</code> function to change the selector clears all
* properties !
*
- * @version $Revision: 1.37 $
+ * @version $Revision: 1.38 $
*/
public final class CssSelectors extends SelectorsList
implements CssSelectorsConstant, Comparable<CssSelectors> {
@@ -177,6 +177,17 @@
String spec = ac.getPropertyKey();
+ if (ac.getTreatVendorExtensionsAsWarnings()) {
+ if (ac.getCssVersion() != CssVersion.CSS1) {
+ if (pseudo.startsWith("-")) {
+ // a vendor extension
+ addPseudoClass(new PseudoClassSelector(pseudo));
+ ac.getFrame().addWarning("vendor-ext-pseudo-class", ":" + pseudo);
+ return;
+ }
+ }
+ }
+
// is it a pseudo-class?
String[] ps = PseudoFactory.getPseudoClass(spec);
if (ps != null) {
@@ -207,6 +218,17 @@
}
CssVersion version = ac.getCssVersion();
+
+ if (ac.getTreatVendorExtensionsAsWarnings()) {
+ if (version != CssVersion.CSS1) {
+ if (pseudo.startsWith("-")) {
+ // a vendor extension
+ addPseudoElement(new PseudoElementSelector(pseudo));
+ ac.getFrame().addWarning("vendor-ext-pseudo-element", "::" + pseudo);
+ return;
+ }
+ }
+ }
// is it a pseudo-element?
String[] ps = PseudoFactory.getPseudoElement(version);
if (ps != null) {
Received on Wednesday, 13 February 2013 14:54:32 UTC