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

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

Issue 689243003: fix sky element (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: sync Created 6 years, 1 month 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 | 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 <link rel="import" href="TemplateBinding.sky" /> 6 <link rel="import" href="TemplateBinding.sky" />
7 <script> 7 <script>
8 var Base = Object.create(HTMLElement.prototype, { 8 var Base = {
9 __proto__: HTMLElement.prototype,
10
9 register: function() { 11 register: function() {
10 // |this| is prototype 12 // |this| is prototype
11 var template = document.currentScript.previousElementSibling; 13 var template = document.currentScript.previousElementSibling;
12 if (template && template.localName == 'template') 14 if (template && template.localName == 'template')
13 this.template_ = template; 15 this.template_ = template;
14 }, 16 },
15 17
16 createdCallback: function() { 18 createdCallback: function() {
17 }, 19 },
18 20
(...skipping 15 matching lines...) Expand all
34 // override 36 // override
35 }, 37 },
36 38
37 attributeChangedCallback: function(attrName, oldValue, newValue) { 39 attributeChangedCallback: function(attrName, oldValue, newValue) {
38 // reserved for canonical behavior 40 // reserved for canonical behavior
39 this.attributeChanged(attrName, oldValue, newValue); 41 this.attributeChanged(attrName, oldValue, newValue);
40 }, 42 },
41 43
42 attributeChanged: function(attrName, oldValue, newValue) { 44 attributeChanged: function(attrName, oldValue, newValue) {
43 // override 45 // override
44 }, 46 }
45 }; 47 };
46 48
47 function SkyElement(prototype) { 49 function SkyElement(prototype) {
48 prototype.__proto__ = Base; 50 prototype.__proto__ = Base;
49 document.registerElement(prototype.name, { prototype: prototype }); 51 document.registerElement(prototype.name, { prototype: prototype });
50 prototype.register(); 52 prototype.register();
51 }; 53 };
52 54
53 module.exports = SkyElement; 55 module.exports = SkyElement;
54 </script> 56 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698