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

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

Issue 759663003: Only allow one shadowRoot. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: ojan review. Created 6 years 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/engine/web/tests/data/touch-action-tests.js ('k') | sky/tests/dom/appendChild.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="TemplateBinding.sky" /> 6 <import src="TemplateBinding.sky" />
7 <script> 7 <script>
8 var templates = new Map(); 8 var templates = new Map();
9 9
10 function createPrototype(proto, definition) { 10 function createPrototype(proto, definition) {
(...skipping 13 matching lines...) Expand all
24 }, 24 },
25 25
26 created: function() { 26 created: function() {
27 // override 27 // override
28 }, 28 },
29 29
30 attachedCallback: function() { 30 attachedCallback: function() {
31 if (!this.shadowRoot) { 31 if (!this.shadowRoot) {
32 var template = templates.get(this.localName); 32 var template = templates.get(this.localName);
33 if (template) { 33 if (template) {
34 var shadow = this.createShadowRoot(); 34 var shadow = this.ensureShadowRoot();
35 shadow.appendChild(template.createInstance(this)); 35 shadow.appendChild(template.createInstance(this));
36 } 36 }
37 } 37 }
38 this.attached(); 38 this.attached();
39 }, 39 },
40 40
41 attached: function() { 41 attached: function() {
42 // override 42 // override
43 }, 43 },
44 44
(...skipping 20 matching lines...) Expand all
65 if (template && template.localName === 'template') 65 if (template && template.localName === 'template')
66 templates.set(prototype.name, template); 66 templates.set(prototype.name, template);
67 67
68 document.registerElement(prototype.name, { 68 document.registerElement(prototype.name, {
69 prototype: createPrototype(BasePrototype, prototype), 69 prototype: createPrototype(BasePrototype, prototype),
70 }); 70 });
71 }; 71 };
72 72
73 module.exports = SkyElement; 73 module.exports = SkyElement;
74 </script> 74 </script>
OLDNEW
« no previous file with comments | « sky/engine/web/tests/data/touch-action-tests.js ('k') | sky/tests/dom/appendChild.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698