blob: 35199a9ea4eb26e1db8f2890e52d84f709c30f30 [file] [log] [blame]
Tests that we don't crash when killing an text input's or textarea's renderer and then calling select.
<textarea id="textarea1">textarea</textarea>
<textarea id="textarea2">textarea</textarea>
<textarea id="textarea3">textarea</textarea>
<textarea id="textarea4">textarea</textarea>
<input id="input1">
<input id="input2">
<input id="input3">
<input id="input4">
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
function $(id) {
return document.getElementById(id);
}
function testSettingSelection(tagName) {
var id = tagName + '1';
$(id).style.display = "none";
$(id).select();
id = tagName + '2';
$(id).style.display = "none";
$(id).setSelectionRange(1, 2);
id = tagName + '3';
$(id).style.display = "none";
$(id).selectionStart = 2;
id = tagName + '4';
$(id).style.display = "none";
$(id).selectionEnd = 1;
}
testSettingSelection('textarea');
testSettingSelection('input');
</script>