multipleinsertionpoints-appendsingle-2-shadow.xhtml (999B)
1 <html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"> 2 <head> 3 <script> 4 customElements.define("custom-element", class extends HTMLElement { 5 constructor() { 6 super(); 7 const template = document.getElementById("template"); 8 const shadowRoot = this.attachShadow({mode: "open"}) 9 .appendChild(template.content.cloneNode(true)); 10 } 11 }); 12 13 function boom() 14 { 15 document.body.offsetHeight; 16 17 var parent = document.getElementById("parent"); 18 19 var newelt = document.createElement("span"); 20 newelt.setAttribute("slot", "foo"); 21 newelt.appendChild(document.createTextNode(2)); 22 parent.appendChild(newelt); 23 24 document.body.offsetHeight; 25 document.documentElement.className = ""; 26 } 27 </script> 28 29 </head> 30 <body onload="boom();"> 31 <template id="template"> 32 <div> 33 <slot name="foo"/> 34 </div> 35 <div> 36 <slot/> 37 </div> 38 </template> 39 <custom-element id="parent" style="display: block;"> 40 <div>3</div><span slot="foo">1</span><div>4</div><div>5</div> 41 </custom-element> 42 </body> 43 </html>