tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

multipleinsertionpoints-insertmultiple-shadow.xhtml (1309B)


      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 lastdiv = document.getElementById("last");
     18  var parent = lastdiv.parentNode;
     19 
     20  var newelt = document.createElement("span");
     21  newelt.setAttribute("slot", "foo");
     22  newelt.appendChild(document.createTextNode(1));
     23  parent.insertBefore(newelt, lastdiv);
     24 
     25  newelt = document.createElement("div");
     26  newelt.appendChild(document.createTextNode(4));
     27  parent.insertBefore(newelt, lastdiv);
     28 
     29  newelt = document.createElement("span");
     30  newelt.setAttribute("slot", "foo");
     31  newelt.appendChild(document.createTextNode(2));
     32  parent.insertBefore(newelt, lastdiv);
     33 
     34  document.body.offsetHeight;
     35  document.documentElement.className = "";
     36 }
     37 </script>
     38 
     39 </head>
     40 <body onload="boom();">
     41 <template id="template">
     42  <div>
     43    <slot name="foo"/>
     44  </div>
     45  <div>
     46    <slot/>
     47  </div>
     48 </template>
     49 <custom-element style="display: block;">
     50  <div>3</div><div id="last">5</div>
     51 </custom-element>
     52 </body>
     53 </html>