| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 String visitInlineDart(String code) { | 311 String visitInlineDart(String code) { |
| 312 var unit = parseCompilationUnit(code); | 312 var unit = parseCompilationUnit(code); |
| 313 var file = new SourceFile.text(spanUrlFor(sourceId, transform), code); | 313 var file = new SourceFile.text(spanUrlFor(sourceId, transform), code); |
| 314 var output = new TextEditTransaction(code, file); | 314 var output = new TextEditTransaction(code, file); |
| 315 | 315 |
| 316 for (Directive directive in unit.directives) { | 316 for (Directive directive in unit.directives) { |
| 317 if (directive is UriBasedDirective) { | 317 if (directive is UriBasedDirective) { |
| 318 var uri = directive.uri.stringValue; | 318 var uri = directive.uri.stringValue; |
| 319 var span = _getSpan(file, directive.uri); | 319 var span = _getSpan(file, directive.uri); |
| 320 | 320 |
| 321 var id = resolve(sourceId, uri, transform.logger, span); | 321 var id = resolve(sourceId, uri, transform.logger, span, |
| 322 allowAbsolute: true); |
| 322 if (id == null) continue; | 323 if (id == null) continue; |
| 323 | 324 |
| 324 var primaryId = transform.primaryInput.id; | 325 var primaryId = transform.primaryInput.id; |
| 325 var newUri = assetUrlFor(id, primaryId, transform.logger); | 326 var newUri = assetUrlFor(id, primaryId, transform.logger); |
| 326 if (newUri != uri) { | 327 if (newUri != uri) { |
| 327 output.edit(span.start.offset, span.end.offset, "'$newUri'"); | 328 output.edit(span.start.offset, span.end.offset, "'$newUri'"); |
| 328 } | 329 } |
| 329 } | 330 } |
| 330 } | 331 } |
| 331 | 332 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 'formaction', // in button, input | 383 'formaction', // in button, input |
| 383 'href', // in a, area, link, base, command | 384 'href', // in a, area, link, base, command |
| 384 'icon', // in command | 385 'icon', // in command |
| 385 'manifest', // in html | 386 'manifest', // in html |
| 386 'poster', // in video | 387 'poster', // in video |
| 387 'src', // in audio, embed, iframe, img, input, script, source, track, | 388 'src', // in audio, embed, iframe, img, input, script, source, track, |
| 388 // video | 389 // video |
| 389 ]; | 390 ]; |
| 390 | 391 |
| 391 _getSpan(SourceFile file, AstNode node) => file.span(node.offset, node.end); | 392 _getSpan(SourceFile file, AstNode node) => file.span(node.offset, node.end); |
| OLD | NEW |