OLD | NEW |
(Empty) | |
| 1 <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 2 <body> |
| 3 </body> |
| 4 <script> |
| 5 description('Check there is no placeholder after deleteing last char. You should
run this in DRT.'); |
| 6 var editable; |
| 7 |
| 8 function getEditRoot(element) { |
| 9 return window.testRunner ? internals.shadowRoot(element) : document.body; |
| 10 } |
| 11 |
| 12 function testIt(tagName, value, expected) { |
| 13 var control = document.createElement(tagName); |
| 14 document.body.appendChild(control); |
| 15 control.value = value; |
| 16 control.focus(); |
| 17 control.setSelectionRange(control.value.length, control.value.length); |
| 18 document.execCommand('Delete'); |
| 19 editable = getEditRoot(control).firstChild; |
| 20 shouldBeEqualToString('editable.innerHTML', expected); |
| 21 control.parentNode.removeChild(control); |
| 22 } |
| 23 testIt('input', 'az', 'a'); |
| 24 testIt('input', 'z', ''); |
| 25 testIt('textarea', 'z', ''); |
| 26 testIt('textarea', '\nz', '<br>'); |
| 27 testIt('textarea', 'a\n', 'a<br>'); |
| 28 testIt('textarea', 'line 1\nz', 'line 1<br>'); |
| 29 </script> |
| 30 <script src="../../fast/js/resources/js-test-post.js"></script> |
OLD | NEW |