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

Side by Side Diff: pkg/html_import/lib/src/boot.js

Issue 158083002: introduce web_components pkg for consolidated polyfills (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 The Polymer Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file.
5 */
6 (function(){
7
8 // bootstrap
9
10 // IE shim for CustomEvent
11 if (typeof window.CustomEvent !== 'function') {
12 window.CustomEvent = function(inType) {
13 var e = document.createEvent('HTMLEvents');
14 e.initEvent(inType, true, true);
15 return e;
16 };
17 }
18
19 function bootstrap() {
20 // preload document resource trees
21 HTMLImports.importer.load(document, function() {
22 HTMLImports.parser.parse(document);
23 HTMLImports.readyTime = new Date().getTime();
24 // send HTMLImportsLoaded when finished
25 document.dispatchEvent(
26 new CustomEvent('HTMLImportsLoaded', {bubbles: true})
27 );
28 });
29 };
30
31 if (document.readyState === 'complete') {
32 bootstrap();
33 } else {
34 window.addEventListener('DOMContentLoaded', bootstrap);
35 }
36
37 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698