summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/editing/crashtests/inserthorizontalrule-in-textarea-in-editor-and-undo-on-error-events.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/editing/crashtests/inserthorizontalrule-in-textarea-in-editor-and-undo-on-error-events.html')
-rw-r--r--testing/web-platform/tests/editing/crashtests/inserthorizontalrule-in-textarea-in-editor-and-undo-on-error-events.html31
1 files changed, 31 insertions, 0 deletions
diff --git a/testing/web-platform/tests/editing/crashtests/inserthorizontalrule-in-textarea-in-editor-and-undo-on-error-events.html b/testing/web-platform/tests/editing/crashtests/inserthorizontalrule-in-textarea-in-editor-and-undo-on-error-events.html
new file mode 100644
index 0000000000..204f75a89f
--- /dev/null
+++ b/testing/web-platform/tests/editing/crashtests/inserthorizontalrule-in-textarea-in-editor-and-undo-on-error-events.html
@@ -0,0 +1,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>