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>
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.")
14 alert("FAILURE: The selection is not set correctly after textarea was deleted.")