| <!DOCTYPE html> |
| <html> |
| <body> |
| <textarea cols=5 rows=5> |
| hello |
| |
| </textarea> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script> |
| |
| description('This tests removing empty lines at the end of an textarea.'); |
| |
| var textarea = document.querySelector('textarea'); |
| evalAndLog('textarea.focus();'); |
| evalAndLog('textarea.selectionStart = textarea.selectionEnd = textarea.value.length'); |
| shouldBe('textarea.value' ,'"hello\\n\\n"'); |
| shouldBe('textarea.selectionStart' ,'7'); |
| shouldBe('textarea.selectionEnd' ,'7'); |
| |
| shouldBe('document.execCommand("delete", false, null); textarea.value', '"hello\\n"'); |
| shouldBe('textarea.selectionStart', '6'); |
| shouldBe('textarea.selectionEnd', '6'); |
| |
| shouldBe('document.execCommand("delete", false, null); textarea.value', '"hello"'); |
| shouldBe('textarea.selectionStart', '5'); |
| shouldBe('textarea.selectionEnd', '5'); |
| |
| textarea.style.display = 'none'; |
| |
| var successfullyParsed = true; |
| |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |