Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1503)

Side by Side Diff: packages/csslib/lib/src/css_printer.dart

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « packages/csslib/lib/src/analyzer.dart ('k') | packages/csslib/lib/src/polyfill.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 31
32 String get _newLine => prettyPrint ? '\n' : ' '; 32 String get _newLine => prettyPrint ? '\n' : ' ';
33 String get _sp => prettyPrint ? ' ' : ''; 33 String get _sp => prettyPrint ? ' ' : '';
34 34
35 // TODO(terry): When adding obfuscation we'll need isOptimized (compact w/ 35 // TODO(terry): When adding obfuscation we'll need isOptimized (compact w/
36 // obufuscation) and have isTesting (compact no obfuscation) and 36 // obufuscation) and have isTesting (compact no obfuscation) and
37 // isCompact would be !prettyPrint. We'll need another boolean 37 // isCompact would be !prettyPrint. We'll need another boolean
38 // flag for obfuscation. 38 // flag for obfuscation.
39 bool get _isTesting => !prettyPrint; 39 bool get _isTesting => !prettyPrint;
40 40
41 void visitCalcTerm(CalcTerm node) {
42 emit('${node.text}(');
43 node.expr.visit(this);
44 emit(')');
45 }
46
41 void visitCssComment(CssComment node) { 47 void visitCssComment(CssComment node) {
42 emit('/* ${node.comment} */'); 48 emit('/* ${node.comment} */');
43 } 49 }
44 50
45 void visitCommentDefinition(CommentDefinition node) { 51 void visitCommentDefinition(CommentDefinition node) {
46 emit('<!-- ${node.comment} -->'); 52 emit('<!-- ${node.comment} -->');
47 } 53 }
48 54
49 void visitMediaExpression(MediaExpression node) { 55 void visitMediaExpression(MediaExpression node) {
50 emit(node.andOperator ? ' AND ' : ' '); 56 emit(node.andOperator ? ' AND ' : ' ');
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 513
508 void visitWildcard(Wildcard node) { 514 void visitWildcard(Wildcard node) {
509 emit('*'); 515 emit('*');
510 } 516 }
511 517
512 void visitDartStyleExpression(DartStyleExpression node) { 518 void visitDartStyleExpression(DartStyleExpression node) {
513 // TODO(terry): TBD 519 // TODO(terry): TBD
514 throw UnimplementedError; 520 throw UnimplementedError;
515 } 521 }
516 } 522 }
OLDNEW
« no previous file with comments | « packages/csslib/lib/src/analyzer.dart ('k') | packages/csslib/lib/src/polyfill.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698