| <html> |
| <head> |
| <script> |
| function test() { |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| var ta = document.getElementById('ta'); |
| |
| // Send caret to bottom of textarea |
| ta.focus(); |
| ta.setSelectionRange(ta.value.length, ta.value.length); |
| ta.blur(); |
| |
| ta.focus(); |
| ta.blur(); |
| if (ta.scrollTop != 0) |
| document.getElementById('res').innerHTML = "Test Passed"; |
| } |
| </script> |
| </head> |
| <body onload="test()"> |
| This tests that we don't scroll back to the top when leaving a textarea |
| <br> |
| <textarea id="ta"> |
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| </textarea> |
| <div id="res">Test Failed</div> |
| </body> |
| </html> |