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