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

Side by Side Diff: pkg/mdv/lib/mdv.dart

Issue 22253002: fix packages for latest SDK changes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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
« no previous file with comments | « pkg/custom_element/lib/custom_element.dart ('k') | pkg/mdv/lib/src/node.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // TODO(jmesserly): more commentary here. 5 // TODO(jmesserly): more commentary here.
6 /** 6 /**
7 * This library provides access to Model-Driven-Views APIs on HTML elements. 7 * This library provides access to Model-Driven-Views APIs on HTML elements.
8 * More information can be found at: <https://github.com/toolkitchen/mdv>. 8 * More information can be found at: <https://github.com/toolkitchen/mdv>.
9 */ 9 */
10 library mdv; 10 library mdv;
(...skipping 18 matching lines...) Expand all
29 part 'src/template.dart'; 29 part 'src/template.dart';
30 part 'src/template_iterator.dart'; 30 part 'src/template_iterator.dart';
31 part 'src/text.dart'; 31 part 'src/text.dart';
32 part 'src/text_area_element.dart'; 32 part 'src/text_area_element.dart';
33 33
34 /** Initialize the Model-Driven Views polyfill. */ 34 /** Initialize the Model-Driven Views polyfill. */
35 void initialize() { 35 void initialize() {
36 TemplateElement.mdvPackage = _mdv; 36 TemplateElement.mdvPackage = _mdv;
37 } 37 }
38 38
39 StreamController<DocumentFragment> _instanceCreated; 39
40 typedef DocumentFragmentCreated(DocumentFragment fragment);
41
42 // TODO(jmesserly): ideally this would be a stream, but they don't allow
43 // reentrancy.
44 Set<DocumentFragmentCreated> _instanceCreated;
40 45
41 /** 46 /**
42 * *Warning*: This is an implementation helper for Model-Driven Views and 47 * *Warning*: This is an implementation helper for Model-Driven Views and
43 * should not be used in your code. 48 * should not be used in your code.
44 * 49 *
45 * This event is fired whenever a template is instantiated via 50 * This event is fired whenever a template is instantiated via
46 * [Element.createInstance]. 51 * [Element.createInstance].
47 */ 52 */
48 // TODO(rafaelw): This is a hack, and is neccesary for the polyfill 53 // TODO(rafaelw): This is a hack, and is neccesary for the polyfill
49 // because custom elements are not upgraded during clone() 54 // because custom elements are not upgraded during clone()
50 // TODO(jmesserly): polymer removed this in: 55 // TODO(jmesserly): polymer removed this in:
51 // https://github.com/Polymer/platform/commit/344ffeaae475babb529403f6608588a0fc 73f4e7 56 // https://github.com/Polymer/platform/commit/344ffeaae475babb529403f6608588a0fc 73f4e7
52 Stream<DocumentFragment> get instanceCreated { 57 Set<DocumentFragmentCreated> get instanceCreated {
53 if (_instanceCreated == null) { 58 if (_instanceCreated == null) {
54 _instanceCreated = new StreamController<DocumentFragment>(sync: true); 59 _instanceCreated = new Set<DocumentFragmentCreated>();
55 } 60 }
56 return _instanceCreated.stream; 61 return _instanceCreated;
57 } 62 }
58 63
59 64
60 // TODO(jmesserly): investigate if expandos give us enough performance. 65 // TODO(jmesserly): investigate if expandos give us enough performance.
61 66
62 // The expando for storing our MDV wrappers. 67 // The expando for storing our MDV wrappers.
63 // 68 //
64 // In general, we need state associated with the nodes. Rather than having a 69 // In general, we need state associated with the nodes. Rather than having a
65 // bunch of individual expandos, we keep one per node. 70 // bunch of individual expandos, we keep one per node.
66 // 71 //
(...skipping 23 matching lines...) Expand all
90 } else if (node is Node) { 95 } else if (node is Node) {
91 wrapper = new _NodeExtension(node); 96 wrapper = new _NodeExtension(node);
92 } else { 97 } else {
93 // TODO(jmesserly): this happens for things like CompoundBinding. 98 // TODO(jmesserly): this happens for things like CompoundBinding.
94 wrapper = node; 99 wrapper = node;
95 } 100 }
96 101
97 _mdvExpando[node] = wrapper; 102 _mdvExpando[node] = wrapper;
98 return wrapper; 103 return wrapper;
99 } 104 }
OLDNEW
« no previous file with comments | « pkg/custom_element/lib/custom_element.dart ('k') | pkg/mdv/lib/src/node.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698