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

Side by Side Diff: dart/pkg/template_binding/lib/src/instance_binding_map.dart

Issue 336013003: Version 1.5.0-dev.4.14 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 6 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 template_binding; 5 part of template_binding;
6 6
7 class _InstanceBindingMap { 7 class _InstanceBindingMap {
8 final List bindings; 8 final List bindings;
9 List<_InstanceBindingMap> children; 9 List<_InstanceBindingMap> children;
10 DocumentFragment content; 10 DocumentFragment content;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 if (bindings.isTemplate) { 64 if (bindings.isTemplate) {
65 TemplateBindExtension.decorate(clone, node); 65 TemplateBindExtension.decorate(clone, node);
66 if (delegate != null) { 66 if (delegate != null) {
67 templateBindFallback(clone).bindingDelegate = delegate; 67 templateBindFallback(clone).bindingDelegate = delegate;
68 } 68 }
69 } 69 }
70 70
71 _processBindings(clone, bindings, model, instanceBindings); 71 _processBindings(clone, bindings, model, instanceBindings);
72 return clone; 72 return clone;
73 } 73 }
74
75 // TODO(rafaelw): Setup a MutationObserver on content which clears the expando
76 // so that bindingMaps regenerate when template.content changes.
77 _getInstanceBindingMap(DocumentFragment content, BindingDelegate delegate) {
78 if (delegate == null) delegate = BindingDelegate._DEFAULT;
79
80 if (delegate._bindingMaps == null) delegate._bindingMaps = new Expando();
81 var map = delegate._bindingMaps[content];
82 if (map == null) {
83 map = _createInstanceBindingMap(content, delegate);
84 delegate._bindingMaps[content] = map;
85 }
86 return map;
87 }
OLDNEW
« no previous file with comments | « dart/pkg/template_binding/lib/src/input_element.dart ('k') | dart/pkg/template_binding/lib/src/mustache_tokens.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698