commit-queue@webkit.org | 42fec8f | 2012-12-21 16:19:35 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <body> |
| 3 | <div id="box" onclick="document.getElementById('result').innerHTML = 'FAIL';" style="border:1px dotted red">This tests to make sure that a control click does not result in a click event on the Mac.</div> |
| 4 | <p id='result'>PASS</p> |
| 5 | </body> |
| 6 | </html> |
| 7 | |
| 8 | <script> |
| 9 | if (window.testRunner) { |
| 10 | testRunner.dumpAsText(); |
| 11 | |
| 12 | var isMacOSX = navigator.userAgent.indexOf("Mac OS X") != -1; |
| 13 | if (isMacOSX) { |
| 14 | var box = document.getElementById("box"); |
| 15 | var x = box.offsetParent.offsetLeft + box.offsetLeft + box.offsetWidth / 2; |
| 16 | var y = box.offsetParent.offsetTop + box.offsetTop + box.offsetHeight / 2; |
| 17 | eventSender.dragMode = false; |
| 18 | eventSender.mouseMoveTo(x, y); |
| 19 | eventSender.mouseDown(0, ['ctrlKey']); |
| 20 | eventSender.mouseUp(0, ['ctrlKey']); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | </script> |