You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by de...@apache.org on 2017/09/17 12:30:24 UTC

[myfaces-trinidad] 01/36: fix bug where the css file was missing most of the selectors from the .xss skinning files. The reason was that the AgentAtRuleMatcher was being checked, even for StyleSheetNode's that did not have browsers specified. Therefore only the StyleSheetNodes with browsers specified and that matched the user's browser were being included in the css.

This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit be698c04e6c87f570384f808c2ed941d82254869
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Tue Jan 5 21:17:30 2010 +0000

    fix bug where the css file was missing most of the selectors from the .xss skinning files.
    The reason was that the AgentAtRuleMatcher was being checked, even for StyleSheetNode's that did not have browsers specified.
    Therefore only the StyleSheetNodes with browsers specified and that matched the user's browser were being included in the css.
---
 .../org/apache/myfaces/trinidadinternal/style/util/NameUtils.java   | 5 +++++
 .../trinidadinternal/style/xml/parse/StyleSheetNodeParser.java      | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
index 09ab4c1..8e25ffd 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
@@ -600,6 +600,11 @@ public class NameUtils
             return new boolean[] { true, true };          
         }
       }
+      else
+      {
+        // no agent matcher, so all agents match
+        browserMatched = true;
+      }
     }
 
     return new boolean[] { browserMatched, false };
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
index e760846..0645c50 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
@@ -87,8 +87,10 @@ public class StyleSheetNodeParser extends BaseNodeParser
       styles = new StyleNode[_styles.size()];
       _styles.copyInto(styles);
     }
-   
-    AgentAtRuleMatcher agentMatcher = new AgentAtRuleMatcher(_browsers, _versions);
+    // Do not create an agentMatcher if there are no browsers or versions to compare against.
+    // This way a styleSheetNode will match any browser if it hasn't specified a specific browser.
+    AgentAtRuleMatcher agentMatcher = 
+      (_browsers.isEmpty()) ? null : new AgentAtRuleMatcher(_browsers, _versions);
   
     return new StyleSheetNode(
         styles,

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.