| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <body> | 2 <body> |
| 3 <input type="text" id="text" value="some sample text"> | 3 <input type="text" id="text" value="some sample text"> |
| 4 </body> | 4 </body> |
| 5 </html> | 5 </html> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 // This test checks that if the user right clicks on selected text, | 8 // This test checks that if the user right clicks on selected text, |
| 9 // the selected text doesn't change or get deselected. | 9 // the selected text doesn't change or get deselected. |
| 10 var input = document.getElementById("text"); | 10 var input = document.getElementById("text"); |
| 11 input.focus(); |
| 11 input.selectionStart = 5; | 12 input.selectionStart = 5; |
| 12 input.selectionEnd = 15; | 13 input.selectionEnd = 15; |
| 13 | 14 |
| 14 if (window.testRunner) { | 15 if (window.testRunner) { |
| 15 var x, y; | 16 var x, y; |
| 16 x = input.offsetParent.offsetLeft + input.offsetLeft + input.offsetWidth / 2
; | 17 x = input.offsetParent.offsetLeft + input.offsetLeft + input.offsetWidth / 2
; |
| 17 y = input.offsetParent.offsetTop + input.offsetTop + input.offsetHeight / 2; | 18 y = input.offsetParent.offsetTop + input.offsetTop + input.offsetHeight / 2; |
| 18 eventSender.mouseMoveTo(x, y); | 19 eventSender.mouseMoveTo(x, y); |
| 19 eventSender.contextClick(); | 20 eventSender.contextClick(); |
| 20 } | 21 } |
| 21 | 22 |
| 22 </script> | 23 </script> |
| OLD | NEW |