summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/crashtests/1402904.html
blob: 544d01208ae2edd70dd6254090cf48c654c08453 (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
35
36
37
38
<script>
function onLoad() {
  // For emulating the traditional behavior, collapse Selection to end of the
  // parent of <embed> (<embed> is not a container, therefore, its parent is the
  // deepest last child container element of the <body>).
  getSelection().collapse(
    document.querySelector("embed").parentElement,
    document.querySelector("embed").parentElement.childNodes.length
  ); // Point the <embed>
  const option = document.querySelector("option");
  option.addEventListener("click", () => {
    document.execCommand("forwardDelete");
  });
  const li2 = document.getElementById("li2");
  li2.addEventListener("DOMNodeInserted", () => {
    option.click();
  });
  const select = document.querySelector("select");
  select.parentElement.setAttribute("onpageshow", "onPageShow()");
}

function onPageShow() {
  const li1 = document.getElementById("li1");
  li1.addEventListener("DOMSubtreeModified", () => {
    document.execCommand("selectAll");
    document.execCommand("indent");
  });
  li1.appendChild(document.createElement("legend"));
}
</script>
<body onload="onLoad()">
<select>
<option></option>
</select>
<li id="li1"></li>
<ul contenteditable="true">
<li id="li2"></li>
<embed>a;#2