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

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

Issue 27518006: Practically remove boot.js, adds the initialization from the Dart side of (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
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 b8a5afc9448b57e99e3d1d872159682654e93841..3bf7e7a671c28584c5099d5f711768e1df24eede 100644
--- a/pkg/polymer/lib/src/build/polyfill_injector.dart
+++ b/pkg/polymer/lib/src/build/polyfill_injector.dart
@@ -61,25 +61,20 @@ class PolyfillInjector extends Transformer with PolymerTransformer {
return;
}
- if (!jsInteropFound) {
- // JS interop code is required for Polymer CSS shimming.
+ _addScript(urlSegment) {
document.body.nodes.insert(0, parseFragment(
- '<script src="packages/browser/interop.js"></script>\n'));
+ '<script src="packages/$urlSegment"></script>\n'));
}
+ // JS interop code is required for Polymer CSS shimming.
+ if (!jsInteropFound) _addScript('browser/interop.js');
if (!customElementFound) {
- document.body.nodes.insert(0, parseFragment(
- '<script src="packages/custom_element/custom-elements.debug.js">'
- '</script>\n'));
+ _addScript('custom_element/custom-elements.debug.js');
}
- if (!shadowDomFound) {
- // Insert at the beginning (this polyfill needs to run as early as
- // possible).
- // TODO(jmesserly): this is .debug to workaround issue 13046.
- document.body.nodes.insert(0, parseFragment(
- '<script src="packages/shadow_dom/shadow_dom.debug.js"></script>\n'));
- }
+ // This polyfill needs to be the first one on the body
+ // TODO(jmesserly): this is .debug to workaround issue 13046.
+ if (!shadowDomFound) _addScript('shadow_dom/shadow_dom.debug.js');
Jennifer Messerly 2013/10/17 02:04:35 if you want to fix: this can be .min now, 13046 is
Siggi Cherem (dart-lang) 2013/10/17 02:37:40 :-) funny I thought about fixing this too, but dec
transform.addOutput(
new Asset.fromString(transform.primaryInput.id, document.outerHtml));

Powered by Google App Engine
This is Rietveld 408576698