Bug 1776680 [wpt PR 34603] - [@container] Test invalidation of font-relative units...
[gecko.git] / dom / events / test / test_bug656954.html
blob60f8cf4133ef5f63e689837e551cc862f67b26a3
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=656954
5 -->
6 <head>
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"/>
10 </head>
11 <body>
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=656954">Mozilla Bug 656954</a>
13 <p id="display"></p>
14 <div id="content" style="display: none">
16 </div>
17 <pre id="test">
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",
28 function(evt) {
29 evt.preventDefault();
30 });
31 el.dispatchEvent(e);
32 is(e.defaultPrevented, true, "preventDefault() should have been called!");
34 e = document.createEvent("Event");
35 e.initEvent("foo", true, false);
36 el.dispatchEvent(e);
37 is(e.defaultPrevented, false, "preventDefault() should not have any effect!");
39 </script>
40 </pre>
41 </body>
42 </html>