W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2012

2002/css-validator/org/w3c/css/parser CssPropertyFactory.java,1.32,1.33 CssSelectors.java,1.35,1.36 CssStyle.java,1.12,1.13 Frame.java,1.12,1.13

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Sat, 04 Aug 2012 21:17:05 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1Sxlj5-00089U-F8@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/parser
In directory hutz:/tmp/cvs-serv31218/w3c/css/parser

Modified Files:
	CssPropertyFactory.java CssSelectors.java CssStyle.java 
	Frame.java 
Log Message:
font revamp, still some missing properties for CSS3 and @font-face for CSS2 and CSS3

Index: CssSelectors.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/CssSelectors.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- CssSelectors.java	21 Oct 2011 01:49:08 -0000	1.35
+++ CssSelectors.java	4 Aug 2012 21:17:03 -0000	1.36
@@ -270,8 +270,9 @@
     public void addAttribute(AttributeSelector attribute)
             throws InvalidParamException {
         int _s = size();
+		Selector s;
         for (int i = 0; i < _s; i++) {
-            Selector s = (Selector) getSelector(i);
+            s = getSelector(i);
             // add warnings if some selectors are incompatible
             // e.g. [lang=en][lang=fr]
             if (s instanceof AttributeSelector) {

Index: Frame.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/Frame.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- Frame.java	29 Aug 2011 07:21:00 -0000	1.12
+++ Frame.java	4 Aug 2012 21:17:03 -0000	1.13
@@ -80,6 +80,18 @@
                 warningMessage, 0, ac));
     }
 
+	/**
+	 * Adds a warning to this frame.
+	 *
+	 * @param warningMessage the warning message
+	 *                       (see org.w3c.css.util.Messages.properties).
+	 * @see org.w3c.css.util.Warning
+	 */
+	public void addWarning(String warningMessage, int level) {
+		warnings.addWarning(new Warning(getSourceFile(), getLine(),
+				warningMessage, level, ac));
+	}
+
     /**
      * Adds a warning to this frame with a message.
      *

Index: CssStyle.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/CssStyle.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- CssStyle.java	10 Sep 2011 14:20:13 -0000	1.12
+++ CssStyle.java	4 Aug 2012 21:17:03 -0000	1.13
@@ -54,7 +54,7 @@
     }
 
     /**
-     * Add a warning definition to this style.
+     * Add a warning about redefinition of a property to this style.
      *
      * @param property The property.
      */
@@ -63,6 +63,15 @@
         warnings.addWarning(new Warning(property, "redefinition", 2, ac));
     }
 
+	/**
+	 * Add a warning to this style.
+	 *
+	 * @param warn The Warning.
+	 */
+	public final void addWarning(ApplContext ac, Warning warn) {
+		warnings.addWarning(warn);
+	}
+
     /**
      * Add a property to this style
      *

Index: CssPropertyFactory.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/CssPropertyFactory.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- CssPropertyFactory.java	21 Oct 2011 14:14:41 -0000	1.32
+++ CssPropertyFactory.java	4 Aug 2012 21:17:03 -0000	1.33
@@ -183,12 +183,12 @@
             ArrayList<String> pfsOk = new ArrayList<String>();
             String spec = ac.getPropertyKey();
 
-            for (int i = 0; i < SORTEDPROFILES.length; ++i) {
-                String p = String.valueOf(SORTEDPROFILES[i]);
-                if (!p.equals(spec) && PropertiesLoader.getProfile(p).containsKey(property)) {
-                    pfsOk.add(p);
-                }
-            }
+			for (String p : SORTEDPROFILES) {
+				if (!p.equals(spec) && PropertiesLoader.getProfile(p).containsKey(property)) {
+					pfsOk.add(p);
+				}
+			}
+
             if (pfsOk.size() > 0) {
                 if (ac.getCssProfile() == CssProfile.NONE) {
                     String latestVersion = pfsOk.get(pfsOk.size() - 1);
@@ -263,7 +263,10 @@
                 }
             }
         } else {
-            className = PropertiesLoader.getProfile(ac.getPropertyKey()).getProperty("@" + atRule.keyword() + "." + property);
+			StringBuilder sb = new StringBuilder();
+			// construct the property key
+			sb.append('@').append(atRule.keyword()).append('.').append(property);
+            className = PropertiesLoader.getProfile(ac.getPropertyKey()).getProperty(sb.toString());
         }
         return className;
     }
Received on Saturday, 4 August 2012 21:17:36 UTC

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