5 <script src=
"../../resources/js-test.js"></script>
8 <input id=target type=text
value=
"">
10 description("An event's 'stop propagation', 'stop immediate propagation' and 'canceled' flags should be unset in initEvent");
12 window
.jsTestIsAsync
= true;
14 var e
= document
.createEvent("Event");
15 e
.initEvent("foo", true, true);
18 shouldBeTrue("e.defaultPrevented");
20 e
.stopImmediatePropagation();
22 debug("Running e.initEvent again.");
23 e
.initEvent("foo", true, true);
24 shouldBeFalse("e.defaultPrevented");
26 var target
= document
.getElementById("target");
28 target
.addEventListener("foo", function (ev
) {
29 // This function will run if the propagation flags were reset properly on
30 // the second call to initEvent.
34 target
.dispatchEvent(e
);
36 target
.parentNode
.removeChild(target
);