| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of csslib.visitor; | 5 part of csslib.visitor; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Visitor that produces a formatted string representation of the CSS tree. | 8 * Visitor that produces a formatted string representation of the CSS tree. |
| 9 */ | 9 */ |
| 10 class CssPrinter extends Visitor { | 10 class CssPrinter extends Visitor { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 void visitViewportDirective(ViewportDirective node) { | 134 void visitViewportDirective(ViewportDirective node) { |
| 135 emit('@${node.name}$_sp{$_newLine'); | 135 emit('@${node.name}$_sp{$_newLine'); |
| 136 node.declarations.visit(this); | 136 node.declarations.visit(this); |
| 137 emit('}'); | 137 emit('}'); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void visitMediaDirective(MediaDirective node) { | 140 void visitMediaDirective(MediaDirective node) { |
| 141 emit('$_newLine@media'); | 141 emit('$_newLine@media'); |
| 142 emitMediaQueries(node.mediaQueries); | 142 emitMediaQueries(node.mediaQueries); |
| 143 emit('$_sp{'); | 143 emit('$_sp{'); |
| 144 for (var ruleset in node.rulesets) { | 144 for (var ruleset in node.rules) { |
| 145 ruleset.visit(this); | 145 ruleset.visit(this); |
| 146 } | 146 } |
| 147 emit('$_newLine}'); | 147 emit('$_newLine}'); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void visitHostDirective(HostDirective node) { | 150 void visitHostDirective(HostDirective node) { |
| 151 emit('$_newLine@host$_sp{'); | 151 emit('$_newLine@host$_sp{'); |
| 152 for (var ruleset in node.rulesets) { | 152 for (var ruleset in node.rules) { |
| 153 ruleset.visit(this); | 153 ruleset.visit(this); |
| 154 } | 154 } |
| 155 emit('$_newLine}'); | 155 emit('$_newLine}'); |
| 156 } | 156 } |
| 157 | 157 |
| 158 /** | 158 /** |
| 159 * @page : pseudoPage { | 159 * @page : pseudoPage { |
| 160 * decls | 160 * decls |
| 161 * } | 161 * } |
| 162 */ | 162 */ |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 | 570 |
| 571 void visitWildcard(Wildcard node) { | 571 void visitWildcard(Wildcard node) { |
| 572 emit('*'); | 572 emit('*'); |
| 573 } | 573 } |
| 574 | 574 |
| 575 void visitDartStyleExpression(DartStyleExpression node) { | 575 void visitDartStyleExpression(DartStyleExpression node) { |
| 576 // TODO(terry): TBD | 576 // TODO(terry): TBD |
| 577 throw UnimplementedError; | 577 throw UnimplementedError; |
| 578 } | 578 } |
| 579 } | 579 } |
| OLD | NEW |