OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script> | 3 <script> |
4 function test() | 4 function test() |
5 { | 5 { |
6 if (window.testRunner) { | 6 if (window.testRunner) { |
7 // Mouse events only work after an initial layout | |
8 document.body.offsetLeft; | |
9 eventSender.mouseMoveTo(25, 55); | 7 eventSender.mouseMoveTo(25, 55); |
10 eventSender.mouseDown(); | 8 eventSender.mouseDown(); |
11 eventSender.mouseUp(); | 9 eventSender.mouseUp(); |
12 } | 10 } |
13 } | 11 } |
14 | 12 |
15 function prevDefaultForEvent( evt ) { | 13 function prevDefaultForEvent( evt ) { |
16 log(evt.type + " on target " + evt.target); | 14 log(evt.type + " on target " + evt.target); |
17 evt.preventDefault(); | 15 evt.preventDefault(); |
18 } | 16 } |
19 | 17 |
20 function log(text) { | 18 function log(text) { |
21 document.getElementById('result').innerHTML = document.getElementById('resul
t').innerHTML + "<br>" + text; | 19 document.getElementById('result').innerHTML = document.getElementById('resul
t').innerHTML + "<br>" + text; |
22 } | 20 } |
23 </script> | 21 </script> |
24 </head> | 22 </head> |
25 <body onload="test()"> | 23 <body onload="test()"> |
26 <br> | 24 <br> |
27 This tests that preventDefault called onmousedown will prevent a caret from bein
g placed in the text field. | 25 This tests that preventDefault called onmousedown will prevent a caret from bein
g placed in the text field. |
28 <input id="tf1" style="-khtml-appearance: textfield; position: absolute; top: 50
; left: 10;" onmousedown="prevDefaultForEvent(event)" value="No caret should be
here"></input> | 26 <input id="tf1" style="-khtml-appearance: textfield; position: absolute; top: 50
; left: 10;" onmousedown="prevDefaultForEvent(event)" value="No caret should be
here"></input> |
29 <div id="result" style="position: absolute; top: 70; left: 10;"> | 27 <div id="result" style="position: absolute; top: 70; left: 10;"> |
30 </div> | 28 </div> |
31 </body> | 29 </body> |
32 </html> | 30 </html> |
33 | 31 |
OLD | NEW |