Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / keydown-keypress-preventDefault.html
blob957517c01bdeae9529470379701884750bd7ab05
1 <html>
2 <script>
3 function test() {
4 var tf = document.getElementById('tf');
5 tf.focus();
6 if (window.testRunner) {
7 testRunner.dumpAsText();
8 eventSender.keyDown('F');
9 eventSender.keyDown('A');
10 eventSender.keyDown('I');
11 eventSender.keyDown('L');
12 log(tf.value);
16 function log(msg) {
17 var res = document.getElementById('res');
18 res.innerHTML = res.innerHTML + msg + "<br>";
20 </script>
21 <body onload="test()">
22 This tests that preventing the default behavior for a keydown event will prevent the keypress event from firing, and will prevent text from being inserted.<br>
23 This matches IE7, but not Firefox, which still dispatches a keypress.<br>
24 <input id="tf" onkeydown="log('key down'); return false" onkeypress="log('key press')">
25 <br>
26 <div id="res"></div>
27 </body>
28 </html>