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

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

Issue 26395002: fix polymer copy-instance-attributes feature (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: update pkg.status 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
« no previous file with comments | « pkg/polymer/lib/src/declaration.dart ('k') | pkg/polymer/test/instance_attrs_test.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 part of polymer; 5 part of polymer;
6 6
7 /** 7 /**
8 * Use this annotation to publish a field as an attribute. For example: 8 * Use this annotation to publish a field as an attribute. For example:
9 * 9 *
10 * class MyPlaybackElement extends PolymerElement { 10 * class MyPlaybackElement extends PolymerElement {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 // TODO(jmesserly): use stream or future here? 266 // TODO(jmesserly): use stream or future here?
267 void onMutation(Node node, void listener(MutationObserver obs)) { 267 void onMutation(Node node, void listener(MutationObserver obs)) {
268 new MutationObserver((records, MutationObserver observer) { 268 new MutationObserver((records, MutationObserver observer) {
269 listener(observer); 269 listener(observer);
270 observer.disconnect(); 270 observer.disconnect();
271 })..observe(node, childList: true, subtree: true); 271 })..observe(node, childList: true, subtree: true);
272 } 272 }
273 273
274 void copyInstanceAttributes() { 274 void copyInstanceAttributes() {
275 _declaration._instanceAttributes.forEach((name, value) { 275 _declaration._instanceAttributes.forEach((name, value) {
276 attributes[name] = value; 276 attributes.putIfAbsent(name, () => value);
277 }); 277 });
278 } 278 }
279 279
280 void takeAttributes() { 280 void takeAttributes() {
281 if (_declaration._publishLC == null) return; 281 if (_declaration._publishLC == null) return;
282 attributes.forEach(attributeToProperty); 282 attributes.forEach(attributeToProperty);
283 } 283 }
284 284
285 /** 285 /**
286 * If attribute [name] is mapped to a property, deserialize 286 * If attribute [name] is mapped to a property, deserialize
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 } 921 }
922 922
923 final Logger _observeLog = new Logger('polymer.observe'); 923 final Logger _observeLog = new Logger('polymer.observe');
924 final Logger _eventsLog = new Logger('polymer.events'); 924 final Logger _eventsLog = new Logger('polymer.events');
925 final Logger _unbindLog = new Logger('polymer.unbind'); 925 final Logger _unbindLog = new Logger('polymer.unbind');
926 final Logger _bindLog = new Logger('polymer.bind'); 926 final Logger _bindLog = new Logger('polymer.bind');
927 927
928 final Expando _shadowHost = new Expando<Element>(); 928 final Expando _shadowHost = new Expando<Element>();
929 929
930 final Expando _eventHandledTable = new Expando<Set<Node>>(); 930 final Expando _eventHandledTable = new Expando<Set<Node>>();
OLDNEW
« no previous file with comments | « pkg/polymer/lib/src/declaration.dart ('k') | pkg/polymer/test/instance_attrs_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698