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

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

Issue 835353004: Prevent expandos on all SkyElements. (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/examples/city-list/city-list.sky ('k') | no next file » | 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 <script> 7 <script>
8 var templates = new Map(); 8 var templates = new Map();
9 9
10 var attributeConverters = { 10 var attributeConverters = {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 shadowRootReady() { 96 shadowRootReady() {
97 // override 97 // override
98 } 98 }
99 99
100 createdCallback() { 100 createdCallback() {
101 this.isAttached = false; 101 this.isAttached = false;
102 this.created(); 102 this.created();
103 103
104 Object.preventExtensions(this);
105
104 // Invoke attributeChanged callback when element is first created too. 106 // Invoke attributeChanged callback when element is first created too.
105 var attributes = this.getAttributes(); 107 var attributes = this.getAttributes();
106 for (var i = 0; i < attributes.length; ++i) { 108 for (var i = 0; i < attributes.length; ++i) {
107 var attribute = attributes[i]; 109 var attribute = attributes[i];
108 this.attributeChangedCallback(attribute.name, null, attribute.value); 110 this.attributeChangedCallback(attribute.name, null, attribute.value);
109 } 111 }
110 } 112 }
111 113
112 attachedCallback() { 114 attachedCallback() {
113 if (!this.shadowRoot) { 115 if (!this.shadowRoot) {
(...skipping 29 matching lines...) Expand all
143 oldValue: oldValue, 145 oldValue: oldValue,
144 }); 146 });
145 var handler = this[name + 'Changed']; 147 var handler = this[name + 'Changed'];
146 if (typeof handler == 'function') 148 if (typeof handler == 'function')
147 handler.call(this, oldValue, newValue); 149 handler.call(this, oldValue, newValue);
148 } 150 }
149 }; 151 };
150 152
151 module.exports = SkyElement; 153 module.exports = SkyElement;
152 </script> 154 </script>
OLDNEW
« no previous file with comments | « sky/examples/city-list/city-list.sky ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698