You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/12/09 06:17:07 UTC

[10/10] git commit: [flex-falcon] [refs/heads/develop] - improve CSS handling in FalconJX

improve CSS handling in FalconJX


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/70740bed
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/70740bed
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/70740bed

Branch: refs/heads/develop
Commit: 70740bed84c6684897bc7c17500dfc4385e50b9a
Parents: db870b1
Author: Alex Harui <ah...@apache.org>
Authored: Sun Dec 7 22:59:43 2014 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Dec 8 17:25:02 2014 -0800

----------------------------------------------------------------------
 .../internal/css/codegen/CSSCompilationSession.java     | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/70740bed/compiler/src/org/apache/flex/compiler/internal/css/codegen/CSSCompilationSession.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/css/codegen/CSSCompilationSession.java b/compiler/src/org/apache/flex/compiler/internal/css/codegen/CSSCompilationSession.java
index 08626b0..7c02c6b 100644
--- a/compiler/src/org/apache/flex/compiler/internal/css/codegen/CSSCompilationSession.java
+++ b/compiler/src/org/apache/flex/compiler/internal/css/codegen/CSSCompilationSession.java
@@ -159,6 +159,16 @@ public class CSSCompilationSession
     private boolean keepAllTypeSelectors;
 
     /**
+     * Determine if a rule should be in the output
+     * 
+     * @return true if rule should be in the output
+     */
+    protected boolean keepRule(ICSSRule newRule)
+    {
+        return (keepAllTypeSelectors || activatedRules.contains(newRule));
+    }
+
+    /**
      * Synthesize a normalized CSS model from the {@link ICSSRule}'s activated
      * from {@link #singleSelectorRules}. The normalized CSS
      * does not have "@namespace" rules; Its rules come from different CSS
@@ -172,7 +182,7 @@ public class CSSCompilationSession
         {
             for (final ICSSRule newRule : cssDocument.getRules())
             {
-                if (keepAllTypeSelectors || activatedRules.contains(newRule))
+                if (keepRule(newRule))
                 {
                     addRuleToCodeGeneration(newRule);
                 }