summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/events/keypress-dispatch-crash.html
blob: 3207adbd8c891903b1c6edd65edc41de9b9e7312 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<link rel="author" title="Robert Flack" href="mailto:flackr@chromium.org">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1209098">

<!-- No crash should occur if a keypress is dispatched to a constructed document. -->

<script>
var newDoc = document.implementation.createDocument( "", null);
var testNode = newDoc.createElement('div');
newDoc.append(testNode);

var syntheticEvent = document.createEvent('KeyboardEvents');
syntheticEvent.initKeyboardEvent("keypress");
testNode.dispatchEvent(syntheticEvent)
</script>