OLD | NEW |
1 <html xmlns="http://www.w3.org/1999/xhtml"> | 1 <html xmlns="http://www.w3.org/1999/xhtml"> |
2 <head> | 2 <head> |
3 <script src="../editing.js" language="javascript" type="text/javascript"
></script> | 3 <script src="../editing.js" language="javascript" type="text/javascript"
></script> |
4 <script language="javascript" type="text/javascript"> | 4 <script language="javascript" type="text/javascript"> |
5 function log(str) { | 5 function log(str) { |
6 var li = document.createElement("li"); | 6 var li = document.createElement("li"); |
7 li.appendChild(document.createTextNode(str)); | 7 li.appendChild(document.createTextNode(str)); |
8 var console = document.getElementById("console"); | 8 var console = document.getElementById("console"); |
9 console.appendChild(li); | 9 console.appendChild(li); |
10 } | 10 } |
11 function sendBackwardDeleteKey() { | 11 function sendBackwardDeleteKey() { |
12 if (window.eventSender) | 12 if (window.eventSender) |
13 eventSender.keyDown(String.fromCharCode(0x0008), null); | 13 eventSender.keyDown("backspace", null); |
14 } | 14 } |
15 function editingTest() { | 15 function editingTest() { |
16 if (window.testRunner) | 16 if (window.testRunner) |
17 testRunner.dumpAsText(); | 17 testRunner.dumpAsText(); |
18 var testarea = document.getElementById("test"); | 18 var testarea = document.getElementById("test"); |
19 testarea.focus(); | 19 testarea.focus(); |
20 typeCharacterCommand(String.fromCharCode(0x0E27)); | 20 typeCharacterCommand(String.fromCharCode(0x0E27)); |
21 typeCharacterCommand(String.fromCharCode(0x0E31)); | 21 typeCharacterCommand(String.fromCharCode(0x0E31)); |
22 moveSelectionBackwardByCharacterCommand(); | 22 moveSelectionBackwardByCharacterCommand(); |
23 moveSelectionForwardByCharacterCommand(); | 23 moveSelectionForwardByCharacterCommand(); |
24 sendBackwardDeleteKey(); | 24 sendBackwardDeleteKey(); |
25 if (testarea.textContent == "\u0E27") | 25 if (testarea.textContent == "\u0E27") |
26 log("Succeeded."); | 26 log("Succeeded."); |
27 else | 27 else |
28 log("Failed. Actual: \"" + testarea.textContent + "\", Expected:
\"\u0E27\""); | 28 log("Failed. Actual: \"" + testarea.textContent + "\", Expected:
\"\u0E27\""); |
29 } | 29 } |
30 </script> | 30 </script> |
31 <title>Editing Test (Deleting a ligature)</title> | 31 <title>Editing Test (Deleting a ligature)</title> |
32 </head> | 32 </head> |
33 <body> | 33 <body> |
34 <p>This test tests whether the BackSpace key deletes only the last chara
cter of a ligature "วั".</p> | 34 <p>This test tests whether the BackSpace key deletes only the last chara
cter of a ligature "วั".</p> |
35 <p>If this test succeeds, you can see "ว" (U+0E27) and a string "
succeeded" below.</p> | 35 <p>If this test succeeds, you can see "ว" (U+0E27) and a string "
succeeded" below.</p> |
36 <div id="test" contenteditable></div> | 36 <div id="test" contenteditable></div> |
37 <ul id="console"></ul> | 37 <ul id="console"></ul> |
38 <script language="javascript" type="text/javascript"> | 38 <script language="javascript" type="text/javascript"> |
39 runEditingTest(); | 39 runEditingTest(); |
40 </script> | 40 </script> |
41 </body> | 41 </body> |
42 </html> | 42 </html> |
OLD | NEW |