OLD | NEW |
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 <import src="TemplateBinding.sky" /> |
7 <script> | 7 <script> |
8 var Base = { | 8 var Base = { |
9 __proto__: HTMLElement.prototype, | 9 __proto__: HTMLElement.prototype, |
10 | 10 |
11 register: function() { | 11 register: function() { |
12 // |this| is prototype | 12 // |this| is prototype |
13 var template = document.currentScript.previousElementSibling; | 13 var template = document.currentScript.previousElementSibling; |
14 if (template && template.localName == 'template') | 14 if (template && template.localName == 'template') |
15 this.template_ = template; | 15 this.template_ = template; |
16 }, | 16 }, |
(...skipping 30 matching lines...) Expand all Loading... |
47 }; | 47 }; |
48 | 48 |
49 function SkyElement(prototype) { | 49 function SkyElement(prototype) { |
50 prototype.__proto__ = Base; | 50 prototype.__proto__ = Base; |
51 document.registerElement(prototype.name, { prototype: prototype }); | 51 document.registerElement(prototype.name, { prototype: prototype }); |
52 prototype.register(); | 52 prototype.register(); |
53 }; | 53 }; |
54 | 54 |
55 module.exports = SkyElement; | 55 module.exports = SkyElement; |
56 </script> | 56 </script> |
OLD | NEW |