Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / ManualTests / ime-keydown-preventdefault.html
blobaa474e937eb1de7efb27a419a72a98f601c275da
1 <html>
2 <body>
3 <p>Typing in the input fields below should not generate text, even with an IME enabled.</p>
5 Type into the input:
6 <input type=text id='input'></input><br>
7 <div id='out' style="float: right"></div>
8 Or the text area:
9 <textarea id='area'></textarea><br>
10 Or the contentEditable area:
11 <div contentEditable id='ce' style="border:1px solid red; height:300px; width:300px;"></div>
12 <script>
13 var input = document.getElementById('input');
14 var area = document.getElementById('area');
15 var ce = document.getElementById('ce');
17 var handleKeyDown = function(e) {
18 document.getElementById('out').innerHTML += "<br>Got a key event -- cancelling";
19 e.preventDefault();
22 input.addEventListener('keydown', handleKeyDown, false);
23 area.addEventListener('keydown', handleKeyDown, false);
24 ce.addEventListener('keydown', handleKeyDown, false);
25 </script>
26 </body>
27 </html>