| Index: LayoutTests/editing/deleting/delete-last-char-in-textarea.html
|
| diff --git a/LayoutTests/editing/deleting/delete-last-char-in-textarea.html b/LayoutTests/editing/deleting/delete-last-char-in-textarea.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c7c7188cef02e05863084686b97d2a4f19c09be1
|
| --- /dev/null
|
| +++ b/LayoutTests/editing/deleting/delete-last-char-in-textarea.html
|
| @@ -0,0 +1,30 @@
|
| +<script src="../../fast/js/resources/js-test-pre.js"></script>
|
| +<body>
|
| +</body>
|
| +<script>
|
| +description('Check there is no placeholder after deleteing last char. You should run this in DRT.');
|
| +var editable;
|
| +
|
| +function getEditRoot(element) {
|
| + return window.testRunner ? internals.shadowRoot(element) : document.body;
|
| +}
|
| +
|
| +function testIt(tagName, value, expected) {
|
| + var control = document.createElement(tagName);
|
| + document.body.appendChild(control);
|
| + control.value = value;
|
| + control.focus();
|
| + control.setSelectionRange(control.value.length, control.value.length);
|
| + document.execCommand('Delete');
|
| + editable = getEditRoot(control).firstChild;
|
| + shouldBeEqualToString('editable.innerHTML', expected);
|
| + control.parentNode.removeChild(control);
|
| +}
|
| +testIt('input', 'az', 'a');
|
| +testIt('input', 'z', '');
|
| +testIt('textarea', 'z', '');
|
| +testIt('textarea', '\nz', '<br>');
|
| +testIt('textarea', 'a\n', 'a<br>');
|
| +testIt('textarea', 'line 1\nz', 'line 1<br>');
|
| +</script>
|
| +<script src="../../fast/js/resources/js-test-post.js"></script>
|
|
|