Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
|
Rick Byers
2015/06/10 21:56:57
nit: omit html, head, body tags: https://www.chrom
| |
| 4 <script src="../../resources/js-test.js"></script> | |
| 5 </head> | |
| 6 <body> | |
| 7 <p id="description"></p> | |
| 8 <select id='top'></select> | |
| 9 <pre id="console"></pre> | |
| 10 <script> | |
| 11 description("Tests to ensure that default action does not occur."); | |
|
Rick Byers
2015/06/10 21:56:57
nit: add "for synthetic mouse events".
| |
| 12 | |
| 13 function focusHandler() { | |
| 14 testFailed('default action should not occur.'); | |
| 15 } | |
| 16 | |
| 17 function mousedownHandler() { | |
| 18 debug('mousedown event is fired.'); | |
| 19 } | |
| 20 | |
| 21 function test() | |
| 22 { | |
| 23 if (window.testRunner) | |
| 24 testRunner.dumpAsText(); | |
| 25 | |
| 26 var node = document.getElementById('top'); | |
| 27 node.addEventListener('focus', focusHandler, false); | |
| 28 node.addEventListener('mousedown', mousedownHandler, false); | |
| 29 var client = node.getBoundingClientRect(); | |
| 30 | |
| 31 var event = new MouseEvent('mousedown', { button: 1 }); | |
| 32 node.dispatchEvent(event); | |
| 33 } | |
| 34 | |
| 35 test(); | |
| 36 </script> | |
| 37 </body> | |
| 38 </html> | |
| OLD | NEW |