You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by so...@apache.org on 2013/09/16 17:30:47 UTC
svn commit: r1523705 -
/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
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()));
}
}