myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sobr...@apache.org
Subject svn commit: r1523705 - /myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
Date Mon, 16 Sep 2013 15:30:47 GMT
Author: sobryan
Date: Mon Sep 16 15:30:47 2013
New Revision: 1523705

URL: http://svn.apache.org/r1523705
Log:
Reverse checkin for TRINIDAD-2414, patch is not necessary.

Modified:
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java?rev=1523705&r1=1523704&r2=1523705&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
Mon Sep 16 15:30:47 2013
@@ -882,7 +882,7 @@ public class FileSystemStyleCache implem
                                 shortStyleClassMap,
                                 namespacePrefixes,
                                 _STYLE_KEY_MAP);
-
+    
     // Return the name of the new style sheet
     return _getFileNames(writerFactory.getFiles());
   }
@@ -1117,6 +1117,11 @@ public class FileSystemStyleCache implem
           {
             String styleClass = selector.substring(1);
             _putStyleClassInShortMap(styleClass, map);
+            // don't shorten styleclasses that are states since they are likely to be added
+            // and removed on the client.
+            if (styleClass != null && !styleClass.startsWith(SkinSelectors.STATE_PREFIX))
+              if (!map.containsKey(styleClass))
+                map.put(styleClass, _getShortStyleClass(map.size()));
 
             if (style.isEmpty())
               emptySelectors.add(styleClass);
@@ -1195,9 +1200,6 @@ public class FileSystemStyleCache implem
    * that start with SkinSelectors.STATE_PREFIX. The reason is that those
    * are likely to be added and removed on the client as the state changes, and
    * we don't want to require the shortened map on the client.
-   * we do not want to compress non-namespaced selectors even with compression turned on
-   * therefore we check the styleClass for namespacePrefix before we decide to put in a
-   * short selector
    */
   private static void _putStyleClassInShortMap(String styleClass, Map map)
   {
@@ -1205,12 +1207,7 @@ public class FileSystemStyleCache implem
         !styleClass.startsWith(SkinSelectors.STATE_PREFIX) &&
         !map.containsKey(styleClass))
     {
-      if (styleClass.indexOf('|') != -1)
-      {
-        // we found a namespace prefix in the selector
-        // so this selector can be compressed
-        map.put(styleClass, _getShortStyleClass(map.size()));
-      }
+      map.put(styleClass, _getShortStyleClass(map.size()));
     }
   }
 



Mime
View raw message