OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script> | |
4 var success; | |
5 function clickHandler(event) { | |
6 success = true; | |
7 } | |
8 | |
9 function runTest() { | |
10 success = false; | |
11 var container = document.getElementById('container'); | |
12 container.addEventListener('click', clickHandler, false); | |
13 | |
14 var plugin = document.getElementById('testPlugin'); | |
15 | |
16 // We have to simulate a mousedown event here instead of click | |
17 // because click events aren't sent down to plugins. | |
18 var evt = document.createEvent('MouseEvent'); | |
19 evt.initMouseEvent('mousedown', true, true, window, 0, | |
20 0, 0, 0, 0, | |
21 false, false, false, false, | |
22 0, null); | |
23 plugin.dispatchEvent(evt); | |
24 | |
25 if (success) { | |
26 document.getElementById('result').innerHTML="Failure, click not filtered
"; | |
27 } else { | |
28 document.getElementById('result').innerHTML="Success."; | |
29 } | |
30 testRunner.dumpAsText(); | |
31 } | |
32 </script> | |
33 | |
34 </head> | |
35 <body onload="runTest();"> | |
36 <p>The support of event filtering for plugins.</p> | |
37 | |
38 <div id="result">Failure, test didn't run</div> | |
39 | |
40 <div id="container"> | |
41 <object id="testPlugin" type="application/x-webkit-test-netscape" | |
42 width="400" height="400" windowedPlugin="false" alwaysFilterEvents="true">plugin
didn't load.</object> | |
43 </div> | |
44 | |
45 </body> | |
46 </html> | |
OLD | NEW |