You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2008/01/25 23:33:00 UTC

svn commit: r615380 - /myfaces/trinidad/branches/1.2.5.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java

Author: arobinson74
Date: Fri Jan 25 14:32:49 2008
New Revision: 615380

URL: http://svn.apache.org/viewvc?rev=615380&view=rev
Log:
Fix for TRINIDAD-920

Modified:
    myfaces/trinidad/branches/1.2.5.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java

Modified: myfaces/trinidad/branches/1.2.5.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.5.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java?rev=615380&r1=615379&r2=615380&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.5.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java (original)
+++ myfaces/trinidad/branches/1.2.5.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java Fri Jan 25 14:32:49 2008
@@ -188,7 +188,7 @@
         {
           StyleNode matchingStyle = matchingStyles[j];
           String selector = matchingStyle.getSelector();
-
+          
           // We should always have a selector at this point
           assert (selector != null);
 
@@ -228,6 +228,7 @@
           {
             String shortSelector = _getShortSelector(mappedSelector,
                                                      shortStyleClassMap);
+
             if (shortSelector == null)
               shortSelector = mappedSelector;
 
@@ -253,7 +254,7 @@
             {
               String validShortSelector =
                 _getValidFullNameSelector(shortSelector, namespacePrefixArray);
-
+              
               // if we wrote out a full style, check to see if we need to write out the short, too.
               // if it is something different, write out the short, too.
               if (validFullNameSelector != null)
@@ -745,7 +746,7 @@
     {
       String[] selectorArray =
         _orderPseudoElementsAndClasses(selector);
-
+      
       // map selectors, if needed
       // any of the selectors that start with a namespace prefix will
       // be mapped.
@@ -757,7 +758,6 @@
                                             selector,
                                             selectorArray,
                                             false);
-
     }
     else
     {
@@ -898,7 +898,7 @@
       colonIndex = 0;
     String afterDoubleColon = wholeAfSelector.substring(colonIndex);
 
-    // now find the part with a single ':', a ' ', or a '.'. That is where
+    // now find the part with a single ':', a ' ', a '[', or a '.'. That is where
     // I want to chop it to get my 'main' piece of the component selector.
     boolean end = false;
     int afterLength = afterDoubleColon.length();
@@ -907,7 +907,7 @@
     for (; ((endIndex < afterLength) && !end); endIndex++)
     {
       c = afterDoubleColon.charAt(endIndex);
-      end = (Character.isWhitespace(c)) || (c == '.') || (c == ':');
+      end = (Character.isWhitespace(c)) || (c == '.') || (c == ':') || (c == '[');
     }
 
     // Set the main piece in the pieces object
@@ -1111,7 +1111,7 @@
   // style class selector
   private static boolean _isStyleClassTerminator(char c)
   {
-    return (Character.isWhitespace(c) || (c == ':') || (c == '.'));
+    return (Character.isWhitespace(c) || (c == ':') || (c == '.') || (c == '['));
   }
 
   // Gets the properties of the specified StyleNode in sorted
@@ -1200,7 +1200,7 @@
     {
       char x = selector.charAt(i);
 
-      if ((x == ':') || (x == '.'))
+      if ((x == ':') || (x == '.') || (x == '['))
       {
         if (inPseudoClass)
         {
@@ -1216,7 +1216,7 @@
           inPseudoClass = true;
           pseudoClassBuffer.append(x);
         }
-        else if (x == '.')
+        else if (x == '.' || x == '[')
         {
           completeBuffer.append(x);
         }