test_bug970363.html (1418B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=970363 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 970363</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <script src="/tests/SimpleTest/EventUtils.js"></script> 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 12 </head> 13 <body> 14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=970363">Mozilla Bug 970363</a> 15 <p id="display"></p> 16 <div id="content" style="display: none"> 17 </div> 18 <div contenteditable="true" id='editablediv'> 19 <div id='t'>S<span contenteditable="false">readonly</span>E</div> 20 </div> 21 <pre id="test"> 22 23 <script type="application/javascript"> 24 25 /** Test for Bug 970363 */ 26 27 SimpleTest.waitForExplicitFinish(); 28 29 SimpleTest.waitForFocus(function() { 30 var t = document.getElementById("t"); 31 var editablediv = document.getElementById("editablediv"); 32 var sel = window.getSelection(); 33 editablediv.focus(); 34 sel.collapse(t, 0); 35 36 // Move past the 'S' char. 37 synthesizeKey("KEY_ArrowRight"); 38 // Move across the span. 39 synthesizeKey("KEY_ArrowRight"); 40 // Insert an 'I' to show when IP currently is. 41 sendString("I"); 42 43 is(t.textContent, "SreadonlyIE", "the 'I' char should be inserted between 'readonly' and 'E'"); 44 SimpleTest.finish(); 45 }); 46 47 </script> 48 49 </pre> 50 </body> 51 </html>