Issue #2135 - Bug 1453789: Remove Element.createShadowRoot

This commit is contained in:
FranklinDM 2023-03-04 00:32:21 +08:00 committed by roytam1
commit 45c179d01b
19 changed files with 25 additions and 521 deletions

View file

@ -52,7 +52,7 @@ window.GaiaSwitch = (function(win) {
// Extend from the HTMLElement prototype
class GaiaSwitch extends HTMLElement {
connectedCallback() {
var shadow = this.createShadowRoot();
var shadow = this.attachShadow({ mode: "open" });
this._template = template.content.cloneNode(true);
this._input = this._template.querySelector('input[type="checkbox"]');
@ -104,7 +104,7 @@ window.GaiaSwitch = (function(win) {
var template = document.createElement('template');
template.innerHTML = '<label id="switch-label" class="pack-switch">' +
'<input type="checkbox">' +
'<span><content select="label"></content></span>' +
'<span><slot></slot></span>' +
'</label>';
// Register and return the constructor