You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ms...@apache.org on 2012/11/14 13:23:23 UTC

svn commit: r1409179 - in /incubator/flex/falcon/trunk: compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNode.java

Author: mschmalle
Date: Wed Nov 14 12:23:22 2012
New Revision: 1409179

URL: http://svn.apache.org/viewvc?rev=1409179&view=rev
Log:
FLEX-33261 Applied Cyrill Zadra patches FLEX-33261.patch, FLEX-33261.unittest.patch

Modified:
    incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java
    incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNode.java

Modified: incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java?rev=1409179&r1=1409178&r2=1409179&view=diff
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java (original)
+++ incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNodeTests.java Wed Nov 14 12:23:22 2012
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTha
 
 import org.apache.flex.compiler.css.ICSSDocument;
 import org.apache.flex.compiler.css.ICSSRule;
+import org.apache.flex.compiler.internal.caches.CSSDocumentCache;
 import org.apache.flex.compiler.tree.ASTNodeID;
 import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLStyleNode;
@@ -67,6 +68,9 @@ public class MXMLStyleNodeTests extends 
 		String code = "<fx:Style/>";
 		IMXMLStyleNode node = getMXMLStyleNode(code);
 		assertThat("getChildCount", node.getChildCount(), is(0));
+		
+		ICSSDocument cssDoc = node.getCSSDocument(null);
+		assertThat(cssDoc, is(CSSDocumentCache.EMPTY_CSS_DOCUMENT));
 	}
 	
 	@Test
@@ -75,6 +79,9 @@ public class MXMLStyleNodeTests extends 
 		String code = "<fx:Style></fx:Style>";
 		IMXMLStyleNode node = getMXMLStyleNode(code);
 		assertThat("getChildCount", node.getChildCount(), is(0));
+		
+		ICSSDocument cssDoc = node.getCSSDocument(null);
+		assertThat(cssDoc, is(CSSDocumentCache.EMPTY_CSS_DOCUMENT));
 	}
 	
 	@Test
@@ -83,6 +90,9 @@ public class MXMLStyleNodeTests extends 
 		String code = "<fx:Style/> \t\r\n<fx:Style/>";
 		IMXMLStyleNode node = getMXMLStyleNode(code);
 		assertThat("getChildCount", node.getChildCount(), is(0));
+		
+		ICSSDocument cssDoc = node.getCSSDocument(null);
+		assertThat(cssDoc, is(CSSDocumentCache.EMPTY_CSS_DOCUMENT));
 	}
 	
 	@Test

Modified: incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNode.java
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNode.java?rev=1409179&r1=1409178&r2=1409179&view=diff
==============================================================================
--- incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNode.java (original)
+++ incubator/flex/falcon/trunk/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLStyleNode.java Wed Nov 14 12:23:22 2012
@@ -81,7 +81,7 @@ class MXMLStyleNode extends MXMLNodeBase
     {
         if (cssDocument == null)
         {
-            if (cssText != null && !cssText.isEmpty())
+            if (cssText != null && !cssText.isEmpty() && !cssText.trim().isEmpty())
             {
                 ANTLRStringStream stream = new ANTLRStringStream(cssText);
                 stream.name = getSourcePath();