]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes #9545 SASS mixin nesting bugs with mixin. Fixes issue with blocknodes showing... 39/239/1
authorSebastian Nyholm <sebastian@vaadin.com>
Mon, 12 Nov 2012 07:57:53 +0000 (09:57 +0200)
committerSebastian Nyholm <sebastian@vaadin.com>
Mon, 12 Nov 2012 07:57:53 +0000 (09:57 +0200)
Change-Id: Iba2dd3ddc3136ddba93e9653614b42f0b0dca971

theme-compiler/src/com/vaadin/sass/visitor/BlockNodeHandler.java

index efbfc4b8ff90db964316af85c20fa24ac758a996..d338cb084325099e1b3f884d65ae8b0259f37e0d 100644 (file)
 package com.vaadin.sass.visitor;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 
 import com.vaadin.sass.tree.BlockNode;
 import com.vaadin.sass.tree.Node;
 
 public class BlockNodeHandler {
 
+    private static HashMap<Node, Node> lastNodeAdded = new HashMap<Node, Node>();
+
     public static void traverse(BlockNode node) {
 
         Node parent = node.getParentNode();
@@ -57,7 +60,15 @@ public class BlockNodeHandler {
 
         }
         node.setSelectorList(newList);
-        node.getParentNode().getParentNode()
-                .appendChild(node, node.getParentNode());
+        Node oldParent = node.getParentNode();
+        if (lastNodeAdded.get(oldParent) != null) {
+            node.getParentNode().getParentNode()
+                    .appendChild(node, lastNodeAdded.get(oldParent));
+        } else {
+            node.getParentNode().getParentNode()
+                    .appendChild(node, node.getParentNode());
+        }
+
+        lastNodeAdded.put(oldParent, node);
     }
 }