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 /** Transfomer that inlines polymer-element definitions from html imports. */ | 5 /** Transfomer that inlines polymer-element definitions from html imports. */ |
6 library polymer.src.build.import_inliner; | 6 library polymer.src.build.import_inliner; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:convert'; | 9 import 'dart:convert'; |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 */ | 143 */ |
144 Future _collectImportedDocuments(AssetId id, Transform transform, | 144 Future _collectImportedDocuments(AssetId id, Transform transform, |
145 Set<AssetId> seen, List documents) { | 145 Set<AssetId> seen, List documents) { |
146 return readAsHtml(id, transform).then((document) { | 146 return readAsHtml(id, transform).then((document) { |
147 return _visitImports(document, id, transform, seen, documents).then((_) { | 147 return _visitImports(document, id, transform, seen, documents).then((_) { |
148 new _UrlNormalizer(transform, id).visit(document); | 148 new _UrlNormalizer(transform, id).visit(document); |
149 documents.add(document); | 149 documents.add(document); |
150 }); | 150 }); |
151 }); | 151 }); |
152 } | 152 } |
| 153 |
| 154 String toString() => 'polymer-import-inliner'; |
153 } | 155 } |
154 | 156 |
155 /** Internally adjusts urls in the html that we are about to inline. */ | 157 /** Internally adjusts urls in the html that we are about to inline. */ |
156 class _UrlNormalizer extends TreeVisitor { | 158 class _UrlNormalizer extends TreeVisitor { |
157 final Transform transform; | 159 final Transform transform; |
158 | 160 |
159 /** Asset where the original content (and original url) was found. */ | 161 /** Asset where the original content (and original url) was found. */ |
160 final AssetId sourceId; | 162 final AssetId sourceId; |
161 | 163 |
162 _UrlNormalizer(this.transform, this.sourceId); | 164 _UrlNormalizer(this.transform, this.sourceId); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 'cite', // in blockquote, del, ins, q | 220 'cite', // in blockquote, del, ins, q |
219 'data', // in object | 221 'data', // in object |
220 'formaction', // in button, input | 222 'formaction', // in button, input |
221 'href', // in a, area, link, base, command | 223 'href', // in a, area, link, base, command |
222 'icon', // in command | 224 'icon', // in command |
223 'manifest', // in html | 225 'manifest', // in html |
224 'poster', // in video | 226 'poster', // in video |
225 'src', // in audio, embed, iframe, img, input, script, source, track, | 227 'src', // in audio, embed, iframe, img, input, script, source, track, |
226 // video | 228 // video |
227 ]; | 229 ]; |
OLD | NEW |