зеркало из https://github.com/mozilla/gecko-dev.git
29 строки
724 B
HTML
29 строки
724 B
HTML
<body>
|
|
<script type="application/javascript">
|
|
'use strict';
|
|
// -sp-context: content
|
|
(function () {
|
|
class UiComponentTest extends HTMLDivElement {
|
|
constructor() {
|
|
super();
|
|
this.template = `<style></style>`;
|
|
}
|
|
|
|
connectedCallback() {
|
|
let shadow = this.createShadowRoot();
|
|
if (this.template) {
|
|
let te = document.createElement('template');
|
|
te.innerHTML = this.template;
|
|
shadow.appendChild(document.importNode(te.content, true));
|
|
}
|
|
}
|
|
};
|
|
|
|
customElements.define('ui-component-test', UiComponentTest, { extend: 'div'} );
|
|
|
|
let uic = new UiComponentTest();
|
|
document.body.appendChild(uic);
|
|
})();
|
|
</script>
|
|
</body>
|