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

Side by Side Diff: pkg/polymer/lib/src/loader.dart

Issue 27307004: Converting Polymer's WebComponentsLoaded to an onReady future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
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 part of polymer; 5 part of polymer;
6 6
7 /** Annotation used to automatically register polymer elements. */ 7 /** Annotation used to automatically register polymer elements. */
8 class CustomTag { 8 class CustomTag {
9 final String tagName; 9 final String tagName;
10 const CustomTag(this.tagName); 10 const CustomTag(this.tagName);
(...skipping 24 matching lines...) Expand all
35 (_) => performMicrotaskCheckpoint()); 35 (_) => performMicrotaskCheckpoint());
36 36
37 // TODO(jmesserly): mdv should use initMdv instead of mdv.initialize. 37 // TODO(jmesserly): mdv should use initMdv instead of mdv.initialize.
38 mdv.initialize(); 38 mdv.initialize();
39 document.register(PolymerDeclaration._TAG, PolymerDeclaration); 39 document.register(PolymerDeclaration._TAG, PolymerDeclaration);
40 40
41 for (var lib in libraries) { 41 for (var lib in libraries) {
42 _loadLibrary(lib, srcUrl); 42 _loadLibrary(lib, srcUrl);
43 } 43 }
44 44
45 // TODO(jmesserly): this should be in the custom_element polyfill, not here. 45 Polymer._ready.complete();
46 // notify the system that we are bootstrapped 46
47 document.body.dispatchEvent( 47 // TODO(sigmund): move to boot.dart once it's ready.
48 new CustomEvent('WebComponentsReady', canBubble: true)); 48 document.body.style.transition = 'opacity 0.3s';
49 document.body.style.opacity = '1';
49 }); 50 });
50 } 51 }
51 52
52 /** All libraries in the current isolate. */ 53 /** All libraries in the current isolate. */
53 final _libs = currentMirrorSystem().libraries; 54 final _libs = currentMirrorSystem().libraries;
54 55
55 /** 56 /**
56 * Reads the library at [uriString] (which can be an absolute URI or a relative 57 * Reads the library at [uriString] (which can be an absolute URI or a relative
57 * URI from [srcUrl]), and: 58 * URI from [srcUrl]), and:
58 * 59 *
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 print("warning: methods marked with @initMethod should take no " 142 print("warning: methods marked with @initMethod should take no "
142 "arguments, ${method.simpleName} expects some."); 143 "arguments, ${method.simpleName} expects some.");
143 return; 144 return;
144 } 145 }
145 obj.invoke(method.simpleName, const []); 146 obj.invoke(method.simpleName, const []);
146 } 147 }
147 148
148 class _InitMethodAnnotation { 149 class _InitMethodAnnotation {
149 const _InitMethodAnnotation(); 150 const _InitMethodAnnotation();
150 } 151 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698