Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / editable-div-clear-on-keydown.html
blobec320ad81aefbdff649f1976e57f6aeac89673eb
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 </head>
5 <body>
6 <p>Tests behavior of code that clears the text from a focused editable div.
7 <br><br>To run manually press any key to clear the text in the div.<br>The key that was typed should replace the text in the editable div and div should still have the focus and a blinking caret.</p>
8 <div id="it" style="-webkit-user-modify: read-write;" onkeydown="resetIt(event)" onkeypress="typedChar(event)" onkeyup="checkResult(event)">text</div>
9 <p id="result">TEST NOT RUN YET</p>
10 <script>
11 if (window.testRunner)
12 testRunner.dumpAsText();
14 var it = document.getElementById("it");
15 it.focus();
17 function resetIt(event) {
18 var it = document.getElementById("it");
19 it.innerText = '';
20 it.focus();
23 var lastTypedChar = '';
24 function typedChar(event) {
25 lastTypedChar = String.fromCharCode(event.keyCode);
28 function checkResult(event) {
29 if (lastTypedChar != '') {
30 var text = document.getElementById("it").innerText;
31 if (text != lastTypedChar)
32 document.getElementById("result").innerHTML = "FAIL: editable div content is '" + text + "' and it should be '" + lastTypedChar + "'" ;
33 else
34 document.getElementById("result").innerHTML = "PASS";
38 if (window.eventSender)
39 eventSender.keyDown("a");
40 </script>
41 </body>
42 </html>