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

Side by Side Diff: pkg/polymer/lib/src/build/import_inliner.dart

Issue 196723017: Fix polymer tests and a couple bugs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/polymer/test/build/all_phases_test.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 /// 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
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
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);
OLDNEW
« no previous file with comments | « no previous file | pkg/polymer/test/build/all_phases_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698