summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/editing/crashtests/inserthorizontalrule-in-textarea-in-editor-and-undo-on-error-events.html
blob: 204f75a89fb9506fb02bc591a5390856185424a8 (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
<!doctype html>
<html class="test-wait">
<head>
<meta charset="utf-8">
<script>
var count = 0;
function onError() {
  if (++count > 2) {
    document.documentElement.removeAttribute("class");
    return;
  }
  const object = document.getElementById("a");
  const mi = document.getElementById("b");
  object.data = "";
  object.appendChild(document.getElementById("c"));
  mi.appendChild(document.getElementById("c"));
  getSelection().collapse(document.getElementById("c"), 0);
  document.execCommand("undo");
  document.execCommand("insertHorizontalRule");
}
</script>
</head>
<body>
<textarea id="c">a</textarea>
<dt contenteditable="true">
<mi id="b">#</mi>
<object id="a" onerror="onError()">
</object>
</dt>
</body>
</html>