Chromium Code Reviews| 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)); |