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

Side by Side Diff: sky/framework/sky-element/sky-element.sky

Issue 868973002: Don't set expression attributes before they're bound. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/framework/sky-element/sky-binder.sky ('k') | sky/tests/framework/templates.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Copyright 2014 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 --> 5 -->
6 <import src="sky-binder.sky" as="binder" /> 6 <import src="sky-binder.sky" as="binder" />
7 <import src="element-registry.sky" as="registry" /> 7 <import src="element-registry.sky" as="registry" />
8 <script> 8 <script>
9 function parseAttributeSpec(registration, definition) { 9 function parseAttributeSpec(registration, definition) {
10 var spec = definition.getAttribute('attributes'); 10 var spec = definition.getAttribute('attributes');
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 this.attached(); 126 this.attached();
127 this.isAttached = true; 127 this.isAttached = true;
128 } 128 }
129 129
130 detachedCallback() { 130 detachedCallback() {
131 this.detached(); 131 this.detached();
132 this.isAttached = false; 132 this.isAttached = false;
133 } 133 }
134 134
135 attributeChangedCallback(name, oldValue, newValue) { 135 attributeChangedCallback(name, oldValue, newValue) {
136 if (registry.isExpandableAttribute(name))
137 return;
136 this.attributeChanged(name, oldValue, newValue); 138 this.attributeChanged(name, oldValue, newValue);
137 var registration = registry.getRegistration(this.localName); 139 var registration = registry.getRegistration(this.localName);
138 var converter = registration.attributes.get(name); 140 var converter = registration.attributes.get(name);
139 if (converter) { 141 if (converter) {
140 this.notifyPropertyChanged(name, converter(oldValue), 142 this.notifyPropertyChanged(name, converter(oldValue),
141 converter(newValue)); 143 converter(newValue));
142 } 144 }
143 } 145 }
144 146
145 notifyPropertyChanged(name, oldValue, newValue) { 147 notifyPropertyChanged(name, oldValue, newValue) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 binding.setValue(this[name]); 186 binding.setValue(this[name]);
185 binding.discardChanges(); 187 binding.discardChanges();
186 } 188 }
187 } 189 }
188 this.dirtyPropertyBindings = null; 190 this.dirtyPropertyBindings = null;
189 } 191 }
190 }; 192 };
191 193
192 module.exports = SkyElement; 194 module.exports = SkyElement;
193 </script> 195 </script>
OLDNEW
« no previous file with comments | « sky/framework/sky-element/sky-binder.sky ('k') | sky/tests/framework/templates.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698