| OLD | NEW |
| (Empty) | |
| 1 /** |
| 2 @license |
| 3 Copyright (c) 2017 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 */ |
| 10 'use strict'; |
| 11 |
| 12 /* |
| 13 * Polyfills loaded: Custom Elements, Shady DOM/Shady CSS |
| 14 * Used in: Safari 9, Firefox, Edge |
| 15 */ |
| 16 |
| 17 import '../bower_components/shadydom/src/shadydom.js' |
| 18 import '../bower_components/custom-elements/src/custom-elements.js' |
| 19 import '../bower_components/shadycss/entrypoints/scoping-shim.js' |
| 20 |
| 21 // NOTE: this is a load-bearing IIFE for Closure |
| 22 (function() { |
| 23 let document = window.document; |
| 24 // global for (1) existence means `WebComponentsReady` will file, |
| 25 // (2) WebComponents.ready == true means event has fired. |
| 26 window.WebComponents = window.WebComponents || {}; |
| 27 |
| 28 function fire() { |
| 29 requestAnimationFrame(() => { |
| 30 window.WebComponents.ready = true; |
| 31 window.document.dispatchEvent(new CustomEvent('WebComponentsReady', { bubb
les: true })); |
| 32 }) |
| 33 } |
| 34 |
| 35 function wait() { |
| 36 fire(); |
| 37 document.removeEventListener('readystatechange', wait); |
| 38 } |
| 39 |
| 40 if (document.readyState !== 'loading') { |
| 41 fire(); |
| 42 } else { |
| 43 document.addEventListener('readystatechange', wait); |
| 44 } |
| 45 })(); |
| OLD | NEW |