]> source.dussan.org Git - vaadin-framework.git/commitdiff
(#10174) Value of a variable cannot be assigned to another variable 78/278/1
authorSebastian Nyholm <sebastian@vaadin.com>
Thu, 15 Nov 2012 15:45:19 +0000 (17:45 +0200)
committerSebastian Nyholm <sebastian@vaadin.com>
Thu, 15 Nov 2012 15:45:19 +0000 (17:45 +0200)
Change-Id: Ib6879b685259c775fc9159e572c182093ae69f8d

theme-compiler/src/com/vaadin/sass/tree/VariableNode.java
theme-compiler/src/com/vaadin/sass/visitor/MixinNodeHandler.java
theme-compiler/tests/resources/css/variables.css
theme-compiler/tests/resources/scss/variables.scss
theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Variables.java

index 3ea83798291a2bc8716b4b7bbb0bdcf66b1a3777..89cab3312902bd7ad2698b95a80937fca82c4543 100644 (file)
@@ -77,6 +77,8 @@ public class VariableNode extends Node implements IVariableNode {
                             && expr.getParameters().toString()
                                     .contains("$" + node.getName())) {
                         replaceValues(expr.getParameters(), node);
+                    } else if (expr.getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE) {
+                        replaceValues(expr, node);
                     }
                 }
             }
index 3c31ee10732e34638c31f211a01dd5eb2dcecb44..4875a39b1d0c79105c6389da7a7a2c55d61d2255 100644 (file)
@@ -48,6 +48,7 @@ public class MixinNodeHandler {
         Node pre = mixinNode;
 
         MixinDefNode defClone = (MixinDefNode) DeepCopy.copy(mixinDef);
+        defClone.traverse();
 
         if (mixinDef.getArglist().isEmpty()) {
             for (Node child : new ArrayList<Node>(defClone.getChildren())) {
index d54ae6cd30677eae0122506634e543bf40b0e820..ae5ac5e01ceac2fc1988ffbef56032d1ff43e760 100644 (file)
@@ -3,6 +3,7 @@
        color: #0000ff;
        color1: #0000d1;
        font-family: Arial, Helvetica, "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+       font-size: 12px;
 }
 
 .border {
index 60acc5dd100abbf932b18a88b01fad6557fbc8d7..2448aaddb969101b865e6cc404a7d8eb0e0468e7 100644 (file)
@@ -1,6 +1,7 @@
 $blue: #3bbfce;
 $margin: 8px;
 $chameleon-font-family: Arial, Helvetica, "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+$font: 12px;
 
 .content-navigation {
        border-color: $blue;
@@ -8,6 +9,8 @@ $chameleon-font-family: Arial, Helvetica, "Lucida Grande", "Lucida Sans Unicode"
        color: $blue;
        color1: darken($blue, 9%);
        font-family: $chameleon-font-family;
+       $font-size: $font;
+       font-size: $font-size;
 }
 
 .border {
index d56a9dee9da2c0ba87946ea81cdc490a9825367f..32984c53ecad64a6fdff3c3625d0850202871a53 100644 (file)
@@ -45,7 +45,7 @@ public class Variables extends AbstractTestBase {
         parser.setDocumentHandler(handler);
         parser.parseStyleSheet(getClass().getResource(scss).getPath());
         ScssStylesheet root = handler.getStyleSheet();
-        Assert.assertEquals(5, root.getChildren().size());
+        Assert.assertEquals(6, root.getChildren().size());
 
         VariableNode varNode1 = (VariableNode) root.getChildren().get(0);
         Assert.assertEquals("blue", varNode1.getName());
@@ -58,7 +58,7 @@ public class Variables extends AbstractTestBase {
         Assert.assertEquals(8f, varNode2.getExpr().getFloatValue());
         Assert.assertEquals("px", varNode2.getExpr().getDimensionUnitText());
 
-        BlockNode blockNode1 = (BlockNode) root.getChildren().get(4);
+        BlockNode blockNode1 = (BlockNode) root.getChildren().get(5);
         Assert.assertEquals(3, blockNode1.getChildren().size());
         RuleNode ruleNode1Block1 = (RuleNode) blockNode1.getChildren().get(2);
         Assert.assertEquals("border-color", ruleNode1Block1.getVariable());
@@ -72,7 +72,7 @@ public class Variables extends AbstractTestBase {
                 .getValue().getLexicalUnitType());
         Assert.assertEquals("blue", ruleNode2Block1.getValue().getStringValue());
 
-        BlockNode blockNode2 = (BlockNode) root.getChildren().get(4);
+        BlockNode blockNode2 = (BlockNode) root.getChildren().get(5);
         RuleNode ruleNode1Block2 = (RuleNode) blockNode2.getChildren().get(0);
         Assert.assertEquals("padding", ruleNode1Block2.getVariable());
         Assert.assertEquals(SCSSLexicalUnit.SCSS_VARIABLE, ruleNode1Block2