4 https://bugzilla.mozilla.org/show_bug.cgi?id=656954
7 <title>Test for Bug
656954</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=656954">Mozilla Bug
656954</a>
14 <div id=
"content" style=
"display: none">
18 <script type=
"application/javascript">
20 /** Test for Bug
656954 **/
22 var e = document.createEvent(
"Event");
23 is(e.defaultPrevented, false,
24 "After creating event defaultPrevented should be false");
25 e.initEvent(
"foo", true, true);
26 var el = document.createElement(
"div");
27 el.addEventListener(
"foo",
32 is(e.defaultPrevented, true,
"preventDefault() should have been called!");
34 e = document.createEvent(
"Event");
35 e.initEvent(
"foo", true, false);
37 is(e.defaultPrevented, false,
"preventDefault() should not have any effect!");