mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This CL is just a search-and-replace. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/694423002
57 lines
1.3 KiB
Plaintext
57 lines
1.3 KiB
Plaintext
<!--
|
|
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
-->
|
|
<import src="TemplateBinding.sky" />
|
|
<script>
|
|
var Base = {
|
|
__proto__: HTMLElement.prototype,
|
|
|
|
register: function() {
|
|
// |this| is prototype
|
|
var template = document.currentScript.previousElementSibling;
|
|
if (template && template.localName == 'template')
|
|
this.template_ = template;
|
|
},
|
|
|
|
createdCallback: function() {
|
|
},
|
|
|
|
attachedCallback: function() {
|
|
var shadow = this.createShadowRoot();
|
|
shadow.appendChild(this.template_.createInstance(this));
|
|
this.attached();
|
|
},
|
|
|
|
attached: function() {
|
|
// override
|
|
},
|
|
|
|
dettachedCallback: function() {
|
|
this.dettached();
|
|
},
|
|
|
|
dettached: function() {
|
|
// override
|
|
},
|
|
|
|
attributeChangedCallback: function(attrName, oldValue, newValue) {
|
|
// reserved for canonical behavior
|
|
this.attributeChanged(attrName, oldValue, newValue);
|
|
},
|
|
|
|
attributeChanged: function(attrName, oldValue, newValue) {
|
|
// override
|
|
}
|
|
};
|
|
|
|
function SkyElement(prototype) {
|
|
prototype.__proto__ = Base;
|
|
document.registerElement(prototype.name, { prototype: prototype });
|
|
prototype.register();
|
|
};
|
|
|
|
module.exports = SkyElement;
|
|
</script>
|