summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/accessibility/crashtests/slot-assignment-lockup.html
blob: 85b6c9294a5eaa86c445607b552ece296c509614 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html class="test-wait">
<body>
<script>
customElements.define("my-detail", class extends HTMLElement {
  constructor() {
    super();
    this.attachShadow({ mode: "open", slotAssignment: "manual" });
  }
  connectedCallback() {
    const slot1 = document.createElement("slot");
    const child1 = document.createElement("span");
    this.appendChild(child1);
    child1.innerHTML = "x";
    this.shadowRoot.appendChild(slot1);
    slot1.style.display = "block";
    slot1.assign(child1);
  }
});

function fuzz() {
  document.designMode = 'on';
  document.execCommand("selectAll");
  document.execCommand("InsertText");
  document.documentElement.className = '';
}
window.onload = () => {
  requestAnimationFrame(() => {
    requestAnimationFrame(fuzz);
  });
};
</script>
<my-detail></my-detail>
</body>
</html>