test_bug231389.html (1171B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=231389 5 --> 6 <head> 7 <title>Test for Bug 231389</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 10 </head> 11 <body> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=231389">Mozilla Bug 231389</a> 13 <p id="display"> 14 <textarea id="area" rows="5"> 15 Here 16 is 17 some 18 very 19 long 20 text 21 that 22 we're 23 using 24 for 25 testing 26 purposes 27 </textarea> 28 </p> 29 <div id="content" style="display: none"> 30 31 </div> 32 <pre id="test"> 33 <script type="application/javascript"> 34 35 /** Test for Bug 231389 */ 36 SimpleTest.waitForExplicitFinish(); 37 addLoadEvent(function() { 38 var area = document.getElementById("area"); 39 var val = area.value; 40 var pos = val.indexOf("purposes"); 41 42 is(area.scrollTop, 0, "The textarea should not be scrolled initially"); 43 area.selectionStart = pos; 44 area.selectionEnd = pos; 45 requestAnimationFrame(function() { 46 isnot(area.scrollTop, 0, "The textarea's insertion point should be scrolled into view"); 47 48 SimpleTest.finish(); 49 }); 50 }); 51 52 </script> 53 </pre> 54 </body> 55 </html>