]> source.dussan.org Git - vaadin-framework.git/commitdiff
FontFace nodes are created correctly, fixes #9611 52/52/1
authorMarc Englund <marc@vaadin.com>
Thu, 4 Oct 2012 07:17:38 +0000 (10:17 +0300)
committerMarc Englund <marc@vaadin.com>
Thu, 4 Oct 2012 07:17:38 +0000 (10:17 +0300)
Change-Id: I4ac14c512b7585979f3e88126a7106e469d29f7f

theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java
theme-compiler/src/com/vaadin/sass/tree/FontFaceNode.java [new file with mode: 0644]

index c10d29aad9ec9263cc638b8fdd1ae86bae0faeab..65ae3d5e93ec3b1619ae3dce5132758cccd2d6bc 100644 (file)
@@ -31,6 +31,7 @@ import com.vaadin.sass.parser.LexicalUnitImpl;
 import com.vaadin.sass.tree.BlockNode;
 import com.vaadin.sass.tree.CommentNode;
 import com.vaadin.sass.tree.ExtendNode;
+import com.vaadin.sass.tree.FontFaceNode;
 import com.vaadin.sass.tree.ForNode;
 import com.vaadin.sass.tree.ImportNode;
 import com.vaadin.sass.tree.ListRemoveNode;
@@ -171,12 +172,14 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler {
 
     @Override
     public void startFontFace() throws CSSException {
-        System.out.println("startFontFace()");
+        FontFaceNode node = new FontFaceNode();
+        nodeStack.peek().appendChild(node);
+        nodeStack.push(node);
     }
 
     @Override
     public void endFontFace() throws CSSException {
-        System.out.println("endFontFace()");
+        nodeStack.pop();
     }
 
     @Override
diff --git a/theme-compiler/src/com/vaadin/sass/tree/FontFaceNode.java b/theme-compiler/src/com/vaadin/sass/tree/FontFaceNode.java
new file mode 100644 (file)
index 0000000..3dab4df
--- /dev/null
@@ -0,0 +1,18 @@
+package com.vaadin.sass.tree;
+
+public class FontFaceNode extends Node {
+
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("@font-face {\n");
+
+        for (final Node child : children) {
+            builder.append("\t" + child.toString() + "\n");
+        }
+
+        builder.append("}");
+        return builder.toString();
+    }
+
+}