summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/editing/crashtests/forwarddelete-after-editable-slot-element-outside-body.html
blob: 480f02ded967d5a2e845302d384d03a2c87285c4 (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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
document.addEventListener("DOMContentLoaded", () => {
  const slot = document.createElement("slot");
  document.documentElement.appendChild(slot);
  const anchor = document.querySelector("a[contenteditable]");
  const selection = document.getSelection()
  getSelection().collapse(anchor, 0);
  getSelection().setBaseAndExtent(
    document, 0,
    document.documentElement, document.documentElement.childNodes.length
  );
  const range = selection.getRangeAt(0);
  document.documentElement.contentEditable = true;
  document.documentElement.contentEditable = false;
  range.collapse(false);
  getSelection().removeAllRanges();
  getSelection().addRange(range);
  document.documentElement.contentEditable = true;
  document.execCommand("forwardDelete");
});
</script>
</head><body>
<a contenteditable></a>
</body></html>