You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by jw...@apache.org on 2012/05/09 17:35:42 UTC
svn commit: r1336243 - in
/myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style:
cache/FileSystemStyleCache.java util/CSSGenerationUtils.java
Author: jwaldman
Date: Wed May 9 15:35:42 2012
New Revision: 1336243
URL: http://svn.apache.org/viewvc?rev=1336243&view=rev
Log:
TRINIDAD-2063 generated css file includes selectors with {}
backport to 1.2.12.7.0-branch
Thanks to Anand Nath for the backport patch.
Modified:
myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java
Modified: myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java?rev=1336243&r1=1336242&r2=1336243&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java (original)
+++ myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java Wed May 9 15:35:42 2012
@@ -544,6 +544,9 @@ public class FileSystemStyleCache implem
// etc -- the info that is in the StyleContext.
// These styles contain all the StyleNodes, that is, where selector or
// name (aka alias) are non-null.
+ // If a selector has no properties at all (af|foo {}), it will not be returned in the list of
+ // StyleNodes. It gets into the shortStyleClassMap which has already happened, but
+ // it won't get written to the CSS File.
StyleNode[] styleNodes = _getStyleContextResolvedStyles(context, document);
if (styleNodes == null)
return null;
@@ -1213,7 +1216,9 @@ public class FileSystemStyleCache implem
emptySelectors.removeAll(nonEmptySelectors);
- // Replace all empty keys with an empty string as the selector
+ // Replace all empty keys with an empty string as the selector.
+ // The reason is to keep empty keys from getting written to the HTML.
+ // Empty keys get filtered out of the CSS file when we write to that.
for (String emptyKey : emptySelectors)
map.put(emptyKey, CoreRenderingContext.EMPTY_STYLE_CLASS);
Modified: myfaces/trinidad/branches/1.2.12.7.0-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.12.7.0-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java?rev=1336243&r1=1336242&r2=1336243&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java (original)
+++ myfaces/trinidad/branches/1.2.12.7.0-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java Wed May 9 15:35:42 2012
@@ -183,7 +183,7 @@ public class CSSGenerationUtils
// We only write out styles for which we have a property string.
// All other entries correspond to styles which don't have selectors -
// or styles which will be rendered as a "matching" style.
- if (propertyString != null)
+ if (propertyString != null && !(propertyString.equals("")))
{
// Get all of the styles which share this property string.
StyleNode[] matchingStyles = matchingStylesMap.get(propertyString);