test_bug583225.html (1041B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=583225 5 --> 6 <head> 7 <title>Test for Bug 583225</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=583225">Mozilla Bug 583225</a> 13 <p id="display"></p> 14 <div id="content" style="display: none"> 15 16 </div> 17 <pre id="test"> 18 <script type="application/javascript"> 19 20 /** Test for Bug 583225 */ 21 22 function clicked() 23 { 24 ok(true, "Event fired on DocumentFragment."); 25 SimpleTest.finish(); 26 } 27 28 SimpleTest.waitForExplicitFinish(); 29 30 var docFragment = document.createDocumentFragment(); 31 docFragment.foo = "foo"; 32 docFragment.addEventListener("click", clicked); 33 var event = document.createEvent('MouseEvent'); 34 event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, 35 false, false, 0, docFragment); 36 docFragment.dispatchEvent(event); 37 38 </script> 39 </pre> 40 </body> 41 </html>