compositionstart.data.html (1887B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title id='desc'> CompositionEvent.data for compositionstart Event </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 = "compositionstart"; 17 var TARGET; 18 var ExpectResult = []; 19 var ActualResult = []; 20 21 window.onload = function(e) 22 { 23 try 24 { 25 TARGET = document.getElementById("target"); 26 TARGET.addEventListener(EVENT, TestEvent, true); 27 } 28 catch(ex) 29 { 30 FailTest(); 31 } 32 } 33 34 function TestEvent(evt) 35 { 36 if ((evt.type == EVENT) && (evt.data == "")) 37 { 38 PassTest(); 39 } 40 else 41 { 42 FailTest(); 43 } 44 } 45 </script> 46 </head> 47 <body> 48 <h3>DOM Events</h3> 49 <h4> 50 Test Description: The value of the data attribute of the compositionstart event 51 shall be null for new IME input. 52 </h4> 53 54 <pre> 55 <input id="target" value=""/> 56 57 Steps: 58 1) Open Japanese Microsoft IME and select Hiragana input method 59 2) Click at the above textbox and then type 'a' using keyboard 60 </pre> 61 62 <p>Test passes if the word "PASS" appears below after following the above steps.</p> 63 <div>Test result: </div> 64 <div id='testresult'>FAIL</div> 65 </body> 66 </html>