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