| OLD | NEW |
| 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 /** | 5 /** |
| 6 * Final phase of the polymer transformation: includes any additional polyfills | 6 * Final phase of the polymer transformation: includes any additional polyfills |
| 7 * that may needed by the deployed app. | 7 * that may needed by the deployed app. |
| 8 */ | 8 */ |
| 9 library polymer.src.build.polyfill_injector; | 9 library polymer.src.build.polyfill_injector; |
| 10 | 10 |
| 11 import 'dart:async'; | 11 import 'dart:async'; |
| 12 | 12 |
| 13 import 'package:barback/barback.dart'; | 13 import 'package:barback/barback.dart'; |
| 14 import 'package:html5lib/dom.dart' show Document, Node, DocumentFragment; | 14 import 'package:html5lib/dom.dart' show |
| 15 Document, DocumentFragment, Element, Node; |
| 15 import 'package:html5lib/parser.dart' show parseFragment; | 16 import 'package:html5lib/parser.dart' show parseFragment; |
| 16 import 'common.dart'; | 17 import 'common.dart'; |
| 17 | 18 |
| 18 /** | 19 /** |
| 19 * Ensures that any scripts and polyfills needed to run a polymer application | 20 * Ensures that any scripts and polyfills needed to run a polymer application |
| 20 * are included. For example, this transformer will ensure that there is a | 21 * are included. For example, this transformer will ensure that there is a |
| 21 * script tag that loads the shadow_dom polyfill and interop.js (used for the | 22 * script tag that loads the shadow_dom polyfill and interop.js (used for the |
| 22 * css shimming). | 23 * css shimming). |
| 23 * | 24 * |
| 24 * This step also replaces "packages/browser/dart.js" and the Dart script tag | 25 * This step also replaces "packages/browser/dart.js" and the Dart script tag |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 109 |
| 109 transform.addOutput( | 110 transform.addOutput( |
| 110 new Asset.fromString(transform.primaryInput.id, document.outerHtml)); | 111 new Asset.fromString(transform.primaryInput.id, document.outerHtml)); |
| 111 }); | 112 }); |
| 112 } | 113 } |
| 113 } | 114 } |
| 114 | 115 |
| 115 final _shadowDomJS = new RegExp(r'shadow_dom\..*\.js', caseSensitive: false); | 116 final _shadowDomJS = new RegExp(r'shadow_dom\..*\.js', caseSensitive: false); |
| 116 final _customElementJS = new RegExp(r'custom-elements\..*\.js', | 117 final _customElementJS = new RegExp(r'custom-elements\..*\.js', |
| 117 caseSensitive: false); | 118 caseSensitive: false); |
| OLD | NEW |