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

Unified Diff: pkg/polymer/lib/src/build/polyfill_injector.dart

Issue 27903006: Improves how to initialize polymer apps and fixes polymer build and linter to (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/polymer/lib/src/build/linter.dart ('k') | pkg/polymer/lib/src/build/script_compactor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/build/polyfill_injector.dart
diff --git a/pkg/polymer/lib/src/build/polyfill_injector.dart b/pkg/polymer/lib/src/build/polyfill_injector.dart
index c6c0f884ab92e4eb4ae78dee8ab09446c02eb90d..f9786133c8768dce91168e8abd104470c0753105 100644
--- a/pkg/polymer/lib/src/build/polyfill_injector.dart
+++ b/pkg/polymer/lib/src/build/polyfill_injector.dart
@@ -86,10 +86,13 @@ class PolyfillInjector extends Transformer with PolymerTransformer {
}
// Remove "packages/browser/dart.js"
if (dartJs != null) dartJs.remove();
+ } else if (dartJs == null) {
+ document.body.nodes.add(parseFragment(
+ '<script src="packages/browser/dart.js"></script>'));
}
_addScript(urlSegment) {
- document.body.nodes.insert(0, parseFragment(
+ document.head.nodes.insert(0, parseFragment(
'<script src="packages/$urlSegment"></script>\n'));
}
@@ -99,7 +102,7 @@ class PolyfillInjector extends Transformer with PolymerTransformer {
_addScript('custom_element/custom-elements.debug.js');
}
- // This polyfill needs to be the first one on the body
+ // This polyfill needs to be the first one on the head
// TODO(jmesserly): this is .debug to workaround issue 13046.
if (!shadowDomFound) _addScript('shadow_dom/shadow_dom.debug.js');
« no previous file with comments | « pkg/polymer/lib/src/build/linter.dart ('k') | pkg/polymer/lib/src/build/script_compactor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698