TextEvent.inputMode.IME.html (2083B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title id='desc'> TextEvent: inputMode with DOM_INPUT_METHOD_IME </title> 5 <script type="text/javascript"> 6 var PassTest = function() 7 { 8 document.getElementById("testresult").firstChild.data = "PASS"; 9 } 10 11 var FailTest = function() 12 { 13 document.getElementById("testresult").firstChild.data = "FAIL"; 14 } 15 16 var EVENT = "textInput"; 17 var TARGET; 18 19 function TestEvent(evt) 20 { 21 TARGET.removeEventListener(EVENT, TestEvent, true); 22 if ((0x04 == evt.inputMode) && ("あ" == evt.data)) 23 { 24 PassTest(); 25 } 26 else 27 { 28 FailTest(); 29 } 30 } 31 32 window.onload = function() 33 { 34 try 35 { 36 TARGET = document.getElementById("target"); 37 TARGET.addEventListener(EVENT, TestEvent, true); 38 } 39 catch(ex) 40 { 41 FailTest(); 42 } 43 } 44 </script> 45 </head> 46 <body> 47 <h3>DOM Events</h3> 48 <h4> 49 Test Description: TextEvent.inputMode is DOM_INPUT_METHOD_IME (0x04) 50 when the text string was entered through an Input Method Editor. 51 </h4> 52 53 <span id="parent"> 54 <input id="target" type="text" /> 55 </span> 56 57 <p id="manualsteps"> 58 Steps: 59 <ol> 60 <li> Open Japanese Microsoft IME and select Hiragana input method 61 <li> Click at the above textbox and then type 'a' using keyboard 62 <li> Press '{ENTER}' key to complete the IME composition 63 </ol> 64 </p> 65 <p>Test passes if the word "PASS" appears below after following the above steps.</p> 66 <div>Test result: </div> 67 <div id='testresult'>FAIL</div> 68 </body> 69 </html>