blob: ccee7f8a3b37323b269ee117c1a68a76044b0939 [file] [log] [blame]
function handleEvent(message) {
document.getElementById("log").innerHTML = "PASS: " + message + " handled.<br>";
function test() {
if (window.testRunner) {
var doctype = document.implementation.createDocumentType(
'-//W3C//DTD XHTML 1.0 Strict//EN',
var evt = document.createEvent("Event");
evt.initEvent("generic", true, true);
doctype.addEventListener("generic", function () { handleEvent("generic")}, false);
<body onload="test()">
<p>The test verifies that EventTarget with an event listener not inserted into a Document does not crash during an attempt to dispatch an event.</p>
<p>Test passes if there is no crash, and event is dispatched.</p>
<div id="log">FAIL</div>