slot-assignment-lockup.html (815B)
1 <html class="test-wait"> 2 <body> 3 <script> 4 customElements.define("my-detail", class extends HTMLElement { 5 constructor() { 6 super(); 7 this.attachShadow({ mode: "open", slotAssignment: "manual" }); 8 } 9 connectedCallback() { 10 const slot1 = document.createElement("slot"); 11 const child1 = document.createElement("span"); 12 this.appendChild(child1); 13 child1.innerHTML = "x"; 14 this.shadowRoot.appendChild(slot1); 15 slot1.style.display = "block"; 16 slot1.assign(child1); 17 } 18 }); 19 20 function fuzz() { 21 document.designMode = 'on'; 22 document.execCommand("selectAll"); 23 document.execCommand("InsertText"); 24 document.documentElement.className = ''; 25 } 26 window.onload = () => { 27 requestAnimationFrame(() => { 28 requestAnimationFrame(fuzz); 29 }); 30 }; 31 </script> 32 <my-detail></my-detail> 33 </body> 34 </html>