Chromium Code Reviews| Index: pkg/csslib/lib/src/css_printer.dart |
| diff --git a/pkg/csslib/lib/src/css_printer.dart b/pkg/csslib/lib/src/css_printer.dart |
| index b8000b70a7ea9c40fafdd677aec303d4b312e7fc..d2c8111803add6e1e96d597bcf7868ffa86f9579 100644 |
| --- a/pkg/csslib/lib/src/css_printer.dart |
| +++ b/pkg/csslib/lib/src/css_printer.dart |
| @@ -187,6 +187,34 @@ class CssPrinter extends Visitor { |
| emit(';$_newLine'); |
| } |
| + void visitMixinRulesetDirective(MixinRulesetDirective node) { |
| + emit('@mixin ${node.name} {'); |
| + for (var ruleset in node.rulesets) { |
| + ruleset.visit(this); |
| + } |
| + emit('}'); |
| + } |
| + |
| + void visitMixinDeclarationDirective(MixinDeclarationDirective node) { |
| + emit('@mixin ${node.name} {\n'); |
| + visitDeclarationGroup(node.declarations); |
| + emit('}'); |
| + } |
| + |
| + /** |
| + * Added optional newLine for handling @include at top-level vs/ inside of |
| + * a declaration group. |
| + */ |
| + void visitIncludeDirective(IncludeDirective node, [bool topLevel = true]) { |
| + if (topLevel) emit(_newLine); // Emit newline for top-level @include. |
|
nweiz
2013/09/18 22:40:54
Unnecessary spaces before the comment.
terry
2013/10/09 03:40:33
Done.
|
| + emit('@include ${node.name}'); |
| + if (topLevel) emit(';'); |
|
nweiz
2013/09/18 22:40:54
Why wouldn't non-top-level @includes have a semico
terry
2013/10/09 03:40:33
removed test.On 2013/09/18 22:40:54, nweiz wrote:
|
| + } |
| + |
| + void visitContentDirective(ContentDirective node) { |
|
nweiz
2013/09/18 22:40:54
If you don't support content directives yet, just
terry
2013/10/09 03:40:33
Place holder have errors for content directive in
|
| + // TODO(terry): TBD |
| + } |
| + |
| void visitRuleSet(RuleSet node) { |
| emit("$_newLine"); |
| node._selectorGroup.visit(this); |
| @@ -232,6 +260,11 @@ class CssPrinter extends Visitor { |
| node._expression.visit(this); |
| } |
| + void visitIncludeMixinAtDeclaration(IncludeMixinAtDeclaration node) { |
| + // Don't emit a new line we're inside of a declaration group. |
| + visitIncludeDirective(node.include, false); |
| + } |
| + |
| void visitSelectorGroup(SelectorGroup node) { |
| var selectors = node._selectors; |
| var selectorsLength = selectors.length; |