bug1258308-1.html (1397B)
1 <!DOCTYPE HTML> 2 <html class="reftest-wait"> 3 <head> 4 <script src="/tests/SimpleTest/SimpleTest.js"></script> 5 <script src="/tests/SimpleTest/EventUtils.js"></script> 6 <meta charset="utf-8"> 7 <title>Testcase #1 for bug 1258308</title> 8 <script> 9 function test1() { 10 const kIsMac = navigator.platform.indexOf("Mac") == 0; 11 synthesizeKey("KEY_ArrowDown"); // go to the second line 12 // go to the end of the second line 13 if (kIsMac) { 14 synthesizeKey("KEY_ArrowRight", {accelKey: true}); 15 } else { 16 synthesizeKey("KEY_End"); 17 } 18 synthesizeKey("KEY_ArrowRight", {shiftKey: true}); // select the newline 19 synthesizeKey("KEY_ArrowRight"); // collapse to the end of the selection 20 // caret should now be at the start of the third line 21 document.body.offsetHeight; 22 requestAnimationFrame(() => requestAnimationFrame(() => { 23 document.documentElement.removeAttribute("class"); 24 })); 25 } 26 function runTests() { 27 document.querySelector('textarea').focus(); 28 document.body.offsetHeight; 29 } 30 </script> 31 </head> 32 <body> 33 34 <textarea onfocus="test1()" spellcheck="false" style="-moz-appearance:none;scrollbar-width:none">abc 35 def 36 ghi</textarea> 37 38 <script> 39 SimpleTest.waitForFocus(runTests); 40 </script> 41 </body> 42 </html>