Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / 5497643.html
blob90de6df1f7aeb341bb06c8877a977ed0f9a4c398
1 <p>This tests to make sure that a selection inside a textarea is updated when the textarea is removed from the document.</p>
2 <textarea id="textarea"></textarea>
3 <script>
4 if (window.testRunner)
5 window.testRunner.dumpAsText();
6 textarea = document.getElementById("textarea");
7 textarea.setSelectionRange(0, 0);
8 textarea.parentNode.removeChild(textarea);
9 if (window.getSelection().type == 'Caret' &&
10 window.getSelection().getRangeAt(0).startContainer == document.body &&
11 window.getSelection().getRangeAt(0).startOffset == 2)
12 alert("SUCCESS: Selection is set to position 2 of BODY.")
13 else
14 alert("FAILURE: The selection is not set correctly after textarea was deleted.")
15 </script>