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

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

Issue 817053002: Add shadowRootReady callback for SkyElement. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rename 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 | « no previous file | 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="TemplateBinding.sky" /> 6 <import src="TemplateBinding.sky" />
7 <script> 7 <script>
8 var templates = new Map(); 8 var templates = new Map();
9 9
10 class SkyElement extends HTMLElement { 10 class SkyElement extends HTMLElement {
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 dettached() { 39 dettached() {
40 // override 40 // override
41 } 41 }
42 42
43 attributeChanged(attrName, oldValue, newValue) { 43 attributeChanged(attrName, oldValue, newValue) {
44 // override 44 // override
45 } 45 }
46 46
47 shadowRootReady() {
48 // override
49 }
50
47 createdCallback() { 51 createdCallback() {
48 this.created(); 52 this.created();
49 } 53 }
50 54
51 attachedCallback() { 55 attachedCallback() {
52 if (!this.shadowRoot) { 56 if (!this.shadowRoot) {
53 var template = templates.get(this.localName); 57 var template = templates.get(this.localName);
54 if (template) { 58 if (template) {
55 var shadow = this.ensureShadowRoot(); 59 var shadow = this.ensureShadowRoot();
56 shadow.appendChild(template.createInstance(this)); 60 shadow.appendChild(template.createInstance(this));
61 this.shadowRootReady();
57 } 62 }
58 } 63 }
59 this.attached(); 64 this.attached();
60 } 65 }
61 66
62 dettachedCallback() { 67 dettachedCallback() {
63 this.dettached(); 68 this.dettached();
64 } 69 }
65 70
66 attributeChangedCallback(attrName, oldValue, newValue) { 71 attributeChangedCallback(attrName, oldValue, newValue) {
67 // reserved for canonical behavior 72 // reserved for canonical behavior
68 this.attributeChanged(attrName, oldValue, newValue); 73 this.attributeChanged(attrName, oldValue, newValue);
69 } 74 }
70 }; 75 };
71 76
72 module.exports = SkyElement; 77 module.exports = SkyElement;
73 </script> 78 </script>
OLDNEW
« no previous file with comments | « no previous file | sky/tests/framework/templates.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698