Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / text-control-crash-on-select.html
blob1202599592992de3e888b82817fc0b21d7cef59a
1 Tests that we don't crash when killing an text input's or textarea's renderer and then calling select.
2 <textarea id="textarea1">textarea</textarea>
3 <textarea id="textarea2">textarea</textarea>
4 <textarea id="textarea3">textarea</textarea>
5 <textarea id="textarea4">textarea</textarea>
6 <input id="input1">
7 <input id="input2">
8 <input id="input3">
9 <input id="input4">
10 <script>
11 if (window.testRunner)
12 testRunner.dumpAsText();
14 function $(id) {
15 return document.getElementById(id);
18 function testSettingSelection(tagName) {
19 var id = tagName + '1';
20 $(id).style.display = "none";
21 $(id).select();
23 id = tagName + '2';
24 $(id).style.display = "none";
25 $(id).setSelectionRange(1, 2);
27 id = tagName + '3';
28 $(id).style.display = "none";
29 $(id).selectionStart = 2;
31 id = tagName + '4';
32 $(id).style.display = "none";
33 $(id).selectionEnd = 1;
36 testSettingSelection('textarea');
37 testSettingSelection('input');
38 </script>