summaryrefslogtreecommitdiffstats
path: root/theme-compiler/src/com
diff options
context:
space:
mode:
authorSebastian Nyholm <sebastian@vaadin.com>2012-11-12 09:57:53 +0200
committerSebastian Nyholm <sebastian@vaadin.com>2012-11-12 09:57:53 +0200
commit0ff6013e1afd0e11e0f324275b044381960e5dc4 (patch)
tree29b3a2927a99da7543a037d65bc98fc556934d38 /theme-compiler/src/com
parent85d3cc78842738fe229c17b96f5d5b0d0140a4f2 (diff)
downloadvaadin-framework-0ff6013e1afd0e11e0f324275b044381960e5dc4.tar.gz
vaadin-framework-0ff6013e1afd0e11e0f324275b044381960e5dc4.zip
Fixes #9545 SASS mixin nesting bugs with mixin. Fixes issue with blocknodes showing up in the wrong order
Change-Id: Iba2dd3ddc3136ddba93e9653614b42f0b0dca971
Diffstat (limited to 'theme-compiler/src/com')
-rw-r--r--theme-compiler/src/com/vaadin/sass/visitor/BlockNodeHandler.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/visitor/BlockNodeHandler.java b/theme-compiler/src/com/vaadin/sass/visitor/BlockNodeHandler.java
index efbfc4b8ff..d338cb0843 100644
--- a/theme-compiler/src/com/vaadin/sass/visitor/BlockNodeHandler.java
+++ b/theme-compiler/src/com/vaadin/sass/visitor/BlockNodeHandler.java
@@ -17,12 +17,15 @@
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);
}
}