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 2009/09/01 20:57:54 UTC
svn commit: r810169 -
/myfaces/trinidad/branches/1.2.12.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
Author: jwaldman
Date: Tue Sep 1 18:57:54 2009
New Revision: 810169
URL: http://svn.apache.org/viewvc?rev=810169&view=rev
Log:
TRINIDAD-1561 compressed style class map can yield corrupted css file
Modified:
myfaces/trinidad/branches/1.2.12.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
Modified: myfaces/trinidad/branches/1.2.12.1-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.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java?rev=810169&r1=810168&r2=810169&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java (original)
+++ myfaces/trinidad/branches/1.2.12.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java Tue Sep 1 18:57:54 2009
@@ -627,7 +627,8 @@
}
/**
- * Returns the StyleSheetDocument, parsing the source file if necessary
+ * Returns the StyleSheetDocument, parsing the source file if necessary.
+ * This does not use the StyleContext
*/
private StyleSheetDocument _getStyleSheetDocument(StyleContext context)
{
@@ -638,6 +639,10 @@
return document;
// Otherwise, we create the StyleSheetDocument now
+ // Note, it does not use the StyleContext. This is the StyleSheetDocument
+ // for the entire skin document, so it includes all the specific rules
+ // like @agent ie and @agent gecko, etc. It's later that we output
+ // the css based on the StyleContext.
document = createStyleSheetDocument(context);
// If we weren't able to create the StyleSheetDocument,
@@ -1063,8 +1068,14 @@
Map<String, String> map = new HashMap<String, String>();
assert (document != null);
-
- Iterator<StyleSheetNode> styleSheets = document.getStyleSheets(context);
+ // get all the styleSheets to create the shortened style class map
+ // if we only got the ones based on the StyleContext, then we'd have
+ // to create a shortened map for each StyleContext we receive and cache it.
+ // it's more straightforward, faster, and requires less memory to get
+ // all the styleSheets and create the shortened style class map. There might
+ // be some styles in the map that have no properties in another StyleContext,
+ // but that's ok. It doesn't hurt.
+ Iterator<StyleSheetNode> styleSheets = document.getStyleSheets();
assert (styleSheets != null);
Set<String> emptySelectors = new HashSet<String>();