Chromium Code Reviews| Index: pkg/polymer/lib/boot.js |
| diff --git a/pkg/polymer/lib/boot.js b/pkg/polymer/lib/boot.js |
| index 0a3fe62baaf390456fa263a261a799f8873919a8..2bcb5902bd085fb5cd76725f2780d10b71b63439 100644 |
| --- a/pkg/polymer/lib/boot.js |
| +++ b/pkg/polymer/lib/boot.js |
| @@ -56,8 +56,30 @@ |
| ' tool to compile a depolyable JavaScript version') |
| return; |
| } |
| - document.write( |
| - '<script src="packages/html_import/html_import.min.js"></script>'); |
| + |
| + |
| + // Load HTML Imports: |
| + var htmlImportsSrc = 'src="packages/html_import/html_import.min.js"'; |
| + document.write('<script ' + htmlImportsSrc + '></script>'); |
| + var importScript = document.querySelector('script[' + htmlImportsSrc + ']'); |
| + importScript.addEventListener('load', function() { |
| + // NOTE: this is from polymer/src/lib/dom.js |
| + window.HTMLImports.importer.preloadSelectors += |
| + ', polymer-element link[rel=stylesheet]'; |
| + }); |
| + |
| + // TODO(jmesserly): we need this in deploy tool too. |
| + // NOTE: this is from polymer/src/boot.js: |
| + // FOUC prevention tactic |
| + var style = document.createElement('style'); |
| + style.textContent = 'body {opacity: 0;}'; |
| + var head = document.querySelector('head'); |
| + head.insertBefore(style, head.firstChild); |
| + |
| + window.addEventListener('WebComponentsReady', function() { |
|
blois
2013/09/27 21:40:52
WebComponentsReady comes from the CustomElements p
Jennifer Messerly
2013/09/30 17:44:37
Yes it is right. As TODO notes this code is copy+p
|
| + document.body.style.webkitTransition = 'opacity 0.3s'; |
| + document.body.style.opacity = 1; |
| + }); |
| // Extract a Dart import URL from a script tag, which is the 'src' attribute |
| // of the script tag, or a data-url with the script contents for inlined code. |