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

Side by Side Diff: lib/src/files.dart

Issue 12474002: Support for parsing all CSS and producing one CSS file (Closed) Base URL: https://github.com/dart-lang/web-ui.git@master
Patch Set: merged Created 7 years, 9 months 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library files; 5 library files;
6 6
7 import 'package:html5lib/dom.dart'; 7 import 'package:html5lib/dom.dart';
8 import 'file_system/path.dart'; 8 import 'file_system/path.dart';
9 import 'info.dart'; 9 import 'info.dart';
10 10
11 /** An input file to process by the template compiler. */ 11 /** An input file to process by the template compiler. */
12 class SourceFile { 12 class SourceFile {
13 static const int HTML = 1;
14 static const int DART = 2;
15 static const int STYLESHEET = 3;
16
13 final Path path; 17 final Path path;
18 final int fileType;
Siggi Cherem (dart-lang) 2013/03/07 22:14:20 how about simply 'type' (since we are inside Sourc
terry 2013/03/08 20:11:24 Done.
14 19
15 final bool isDart;
16 Document document; 20 Document document;
17 String code; 21 String code;
22 String linkedCssContent;
Siggi Cherem (dart-lang) 2013/03/07 22:14:20 I think I prefer to simply reuse 'code' for this t
terry 2013/03/08 20:11:24 Done.
18 23
19 SourceFile(this.path, {this.isDart: false}); 24 SourceFile(this.path, {this.fileType: HTML});
25
26 bool get isDart => fileType == DART;
27 bool get isHtml => fileType == HTML;
28 bool get isStyleSheet => fileType == STYLESHEET;
20 29
21 String toString() => "<#SourceFile $path>"; 30 String toString() => "<#SourceFile $path>";
22 } 31 }
23 32
24 /** An output file to generated by the template compiler. */ 33 /** An output file to generated by the template compiler. */
25 class OutputFile { 34 class OutputFile {
26 final Path path; 35 final Path path;
27 final String contents; 36 final String contents;
28 37
29 /** 38 /**
30 * Path to the source file that was transformed into this OutputFile, `null` 39 * Path to the source file that was transformed into this OutputFile, `null`
31 * for files that are generated and do not correspond to an input 40 * for files that are generated and do not correspond to an input
32 * [SourceFile]. 41 * [SourceFile].
33 */ 42 */
34 final Path source; 43 final Path source;
35 44
36 OutputFile(this.path, this.contents, {Path source}) 45 OutputFile(this.path, this.contents, {Path source})
37 : source = source; 46 : source = source;
38 } 47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698