Index: pkg/polymer/lib/src/build/import_inliner.dart |
diff --git a/pkg/polymer/lib/src/build/import_inliner.dart b/pkg/polymer/lib/src/build/import_inliner.dart |
index 40d5ca58d197a51ebea3106ccf5fb457baad3470..beb46eb33b36fadacb54d2a5ae8d37b75161afb1 100644 |
--- a/pkg/polymer/lib/src/build/import_inliner.dart |
+++ b/pkg/polymer/lib/src/build/import_inliner.dart |
@@ -71,8 +71,9 @@ class _HtmlInliner extends PolymerTransformer { |
var rel = tag.attributes['rel']; |
if (rel != 'import' && rel != 'stylesheet') return null; |
+ // Note: URL has already been normalized so use docId. |
var href = tag.attributes['href']; |
- var id = resolve(sourceId, href, transform.logger, tag.sourceSpan, |
+ var id = resolve(docId, href, transform.logger, tag.sourceSpan, |
allowAbsolute: rel == 'stylesheet'); |
if (rel == 'import') { |
@@ -107,7 +108,7 @@ class _HtmlInliner extends PolymerTransformer { |
var insertionPoint = doc.body.firstChild; |
for (var node in doc.head.nodes.toList(growable: false)) { |
if (node is! Element) continue; |
- var tag = node.tagName; |
+ var tag = node.localName; |
var type = node.attributes['type']; |
var rel = node.attributes['rel']; |
if (tag == 'style' || tag == 'script' && |
@@ -121,18 +122,22 @@ class _HtmlInliner extends PolymerTransformer { |
// Loads an asset identified by [id], visits its imports and collects its |
// html imports. Then inlines it into the main document. |
- Future _inlineImport(AssetId id, Element link) => |
- readAsHtml(id, transform).then((doc) => _visitImports(doc, id).then((_) { |
- |
- new _UrlNormalizer(transform, id).visit(doc); |
- _extractScripts(doc); |
- |
- // TODO(jmesserly): figure out how this is working in vulcanizer. |
- // Do they produce a <body> tag with a <head> and <body> inside? |
- var imported = new DocumentFragment(); |
- imported.nodes..addAll(doc.head.nodes)..addAll(doc.body.nodes); |
- link.replaceWith(imported); |
- })); |
+ Future _inlineImport(AssetId id, Element link) { |
+ return readAsHtml(id, transform).then((doc) { |
+ |
Siggi Cherem (dart-lang)
2014/02/27 21:14:06
nit: up to you, but it feels like this empty line
Jennifer Messerly
2014/02/27 21:23:18
yeah, personally I thought it was more readable wi
|
+ new _UrlNormalizer(transform, id).visit(doc); |
Siggi Cherem (dart-lang)
2014/02/27 21:14:06
I'm a bit confused. This is still applied on every
Siggi Cherem (dart-lang)
2014/02/27 21:19:01
just talked offline, I missed that the swap in ord
|
+ return _visitImports(doc, id).then((_) { |
+ |
Siggi Cherem (dart-lang)
2014/02/27 21:14:06
same here
|
+ _extractScripts(doc); |
+ |
+ // TODO(jmesserly): figure out how this is working in vulcanizer. |
+ // Do they produce a <body> tag with a <head> and <body> inside? |
+ var imported = new DocumentFragment(); |
+ imported.nodes..addAll(doc.head.nodes)..addAll(doc.body.nodes); |
+ link.replaceWith(imported); |
+ }); |
+ }); |
+ } |
Future _inlineStylesheet(AssetId id, Element link) { |
return transform.readInputAsString(id).then((css) { |