| OLD | NEW |
| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 * Shadow roots created by [parseElement]. See [getShadowRoot]. | 97 * Shadow roots created by [parseElement]. See [getShadowRoot]. |
| 98 */ | 98 */ |
| 99 final _shadowRoots = new HashMap<String, ShadowRoot>(); | 99 final _shadowRoots = new HashMap<String, ShadowRoot>(); |
| 100 | 100 |
| 101 /** Map of items in the shadow root(s) by their [Element.id]. */ | 101 /** Map of items in the shadow root(s) by their [Element.id]. */ |
| 102 // TODO(jmesserly): various issues: | 102 // TODO(jmesserly): various issues: |
| 103 // * wrap in UnmodifiableMapView? | 103 // * wrap in UnmodifiableMapView? |
| 104 // * should we have an object that implements noSuchMethod? | 104 // * should we have an object that implements noSuchMethod? |
| 105 // * should the map have a key order (e.g. LinkedHash or SplayTree)? | 105 // * should the map have a key order (e.g. LinkedHash or SplayTree)? |
| 106 // * should this be a live list? Polymer doesn't, maybe due to JS limitations? | 106 // * should this be a live list? Polymer doesn't, maybe due to JS limitations? |
| 107 // For now I picked the most performant choice: non-live HashMap. | 107 // Note: this is observable to support $['someId'] being used in templates. |
| 108 final Map<String, Element> $ = new HashMap<String, Element>(); | 108 // The template is stamped before $ is populated, so we need observation if |
| 109 // we want it to be usable in bindings. |
| 110 @reflectable final Map<String, Element> $ = |
| 111 new ObservableMap<String, Element>(); |
| 109 | 112 |
| 110 /** | 113 /** |
| 111 * Gets the shadow root associated with the corresponding custom element. | 114 * Gets the shadow root associated with the corresponding custom element. |
| 112 * | 115 * |
| 113 * This is identical to [shadowRoot], unless there are multiple levels of | 116 * This is identical to [shadowRoot], unless there are multiple levels of |
| 114 * inheritance and they each have their own shadow root. For example, | 117 * inheritance and they each have their own shadow root. For example, |
| 115 * this can happen if the base class and subclass both have `<template>` tags | 118 * this can happen if the base class and subclass both have `<template>` tags |
| 116 * in their `<polymer-element>` tags. | 119 * in their `<polymer-element>` tags. |
| 117 */ | 120 */ |
| 118 // TODO(jmesserly): Polymer does not have this feature. Reconcile. | 121 // TODO(jmesserly): Polymer does not have this feature. Reconcile. |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 class PolymerElement extends HtmlElement with Polymer, Observable { | 1138 class PolymerElement extends HtmlElement with Polymer, Observable { |
| 1136 PolymerElement.created() : super.created() { | 1139 PolymerElement.created() : super.created() { |
| 1137 polymerCreated(); | 1140 polymerCreated(); |
| 1138 } | 1141 } |
| 1139 } | 1142 } |
| 1140 | 1143 |
| 1141 class _PropertyValue { | 1144 class _PropertyValue { |
| 1142 Object oldValue, newValue; | 1145 Object oldValue, newValue; |
| 1143 _PropertyValue(this.oldValue); | 1146 _PropertyValue(this.oldValue); |
| 1144 } | 1147 } |
| OLD | NEW |