39 lines
1.0 KiB
HTML
39 lines
1.0 KiB
HTML
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.testRunner)
|
|
testRunner.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>
|