incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r431966 - /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
Date Wed, 16 Aug 2006 17:48:34 GMT
Author: awiner
Date: Wed Aug 16 10:48:34 2006
New Revision: 431966

URL: http://svn.apache.org/viewvc?rev=431966&view=rev
Log:
Don't issue warnings for 'none' and 'inherit', which are legal values for url() properties.
 Extend this checking to all CSS2.1 properties that are exclusively url()/none/inherit.

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java?rev=431966&r1=431965&r2=431966&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
Wed Aug 16 10:48:34 2006
@@ -25,6 +25,7 @@
 import java.io.Reader;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.HashSet;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -382,18 +383,23 @@
             
             propertyNode = new PropertyNode(propertyName, resolvedUrl);
           }
-          else if(propertyName.equals("background-image"))
-          { // TODO: Add a list of property names expecting an URL here, 
-            // "content" maybe?
-            _LOG.warning("An url value delimited by url() is expected for " +
-                         "the property '" +
-                         propertyName + 
-                         "' in selector '" +
-                         selectorName +
-                         "' in style sheet '" +
-                         sourceName + 
-                         "'. Found: '" + 
-                         propertyValue + "'.");
+          else if (_URI_PROPERTIES.contains(propertyName))
+          { 
+            // Make sure it's a legit value for an URL
+            if (!_SPECIAL_URI_VALUES.contains(propertyValue))
+            {
+              // TODO: Add a list of property names expecting an URL here, 
+              // "content" maybe?
+              _LOG.warning("An url value delimited by url() is expected for " +
+                           "the property '" +
+                           propertyName + 
+                           "' in selector '" +
+                           selectorName +
+                           "' in style sheet '" +
+                           sourceName + 
+                           "'. Found: '" + 
+                           propertyValue + "'.");
+            }
           }
 
           noOraPropertyList.add(propertyNode);
@@ -1078,6 +1084,24 @@
   private static final String _ORA_RULE_REF = "-ora-rule-ref";
   private static final String _ORA_INHIBIT = "-ora-inhibit";
   private static final String _ORA_TEXT_ANTIALIAS = "-ora-text-antialias";
+
+  // Set of values that are legal for url() values
+  private static final Set<String> _URI_PROPERTIES = new HashSet<String>();
+  static
+  {
+    _URI_PROPERTIES.add("background-image");
+    _URI_PROPERTIES.add("cue-after");
+    _URI_PROPERTIES.add("cue-before");
+    _URI_PROPERTIES.add("list-style-image");
+  }
+
+  // Set of values that are legal for url() values
+  private static final Set<String> _SPECIAL_URI_VALUES = new HashSet<String>();
+  static
+  {
+    _SPECIAL_URI_VALUES.add("none");
+    _SPECIAL_URI_VALUES.add("inherit");
+  }
 
   static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(
     SkinStyleSheetParserUtils.class);



Mime
View raw message