OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <title></title> | 3 <title></title> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 <p>This tests that calling input-method functions sends Composition Events and T
ext Events introduced in DOM Level 3.</p> | 6 <p>This tests that calling input-method functions sends Composition Events and T
ext Events introduced in DOM Level 3.</p> |
7 <p>To test manually, enable an IME, input CJK characters, and see this page does
n't show 'FAILED' lines.</p> | 7 <p>To test manually, enable an IME, input CJK characters, and see this page does
n't show 'FAILED' lines.</p> |
8 <input id="test" type="text"/> | 8 <input id="test" type="text"/> |
9 <ul id="console"></ul> | 9 <ul id="console"></ul> |
10 <script language="javascript" type="text/javascript"> | 10 <script language="javascript" type="text/javascript"> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Case 3: Insert a text without composition. | 51 // Case 3: Insert a text without composition. |
52 textInputController.insertText('8'); | 52 textInputController.insertText('8'); |
53 | 53 |
54 // Case 4: Compose a text and commit it by removing the mark. | 54 // Case 4: Compose a text and commit it by removing the mark. |
55 // Only Mac and Chromium ports support unmarkText. | 55 // Only Mac and Chromium ports support unmarkText. |
56 if (textInputController.unmarkText) { | 56 if (textInputController.unmarkText) { |
57 textInputController.setMarkedText('9', 0, 1); | 57 textInputController.setMarkedText('9', 0, 1); |
58 textInputController.unmarkText(); | 58 textInputController.unmarkText(); |
59 } | 59 } |
| 60 |
| 61 // Case 5: Compose a text on selection and commit it. |
| 62 test.value = 'I have a pen'; |
| 63 test.selectionStart = 2; |
| 64 test.selectionEnd = 6; |
| 65 textInputController.setMarkedText('lost', 0, 1); |
| 66 textInputController.insertText('made'); |
| 67 if (test.value == 'I made a pen') { |
| 68 log('SUCCESS: ' + test.value); |
| 69 } else { |
| 70 log('FAILURE: ' + test.value + ' is not "I made a pen".'); |
| 71 } |
60 } | 72 } |
61 </script> | 73 </script> |
62 </body> | 74 </body> |
63 </html> | 75 </html> |
OLD | NEW |