myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sobr...@apache.org
Subject svn commit: r1522914 - /myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
Date Fri, 13 Sep 2013 13:13:16 GMT
Author: sobryan
Date: Fri Sep 13 13:13:15 2013
New Revision: 1522914

URL: http://svn.apache.org/r1522914
Log:
TRINIDAD-2415 - nested selectors not generated correctly when used with icon selectors

Thanks for the patch Anand


Modified:
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java?rev=1522914&r1=1522913&r2=1522914&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
Fri Sep 13 13:13:15 2013
@@ -228,7 +228,14 @@ class SkinStyleSheetParserUtils
         if (StyleUtils.isIcon(selectorName))
         {
           // knock off the '.' if it is the first character.
-          if (selectorName.charAt(0) == '.')
+          // do it only for "Icon:alias", because the style could be something like
+          // ".AFSomeAlias af|style-icon" or ".AFSomeAlias af|style-icon:hover"
+          // and further more, it may not represent an Icon style.
+          // We log a warning in the console that such naming should be used only for Icons,
+          // but we do not enforce this. So user can be already using such a selector as
+          // "af|style-icon" and now want to specify it using a nested selector
+          // this use case will not work if we remove the leading dot.
+          if (selectorName.charAt(0) == '.' &&  selectorName.indexOf("Icon:alias")
> -1)
             selectorName = selectorName.substring(1);
           // strip out :alias
           selectorName = selectorName.replaceFirst(":alias", "");



Mime
View raw message