| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <p>This tests to make sure that a selection inside a textarea is updated when th
e textarea is removed from the document.</p> | 4 <p>This tests to make sure that a selection inside a textarea is updated when th
e textarea is removed from the document.</p> |
| 5 <textarea id="textarea"></textarea> | 5 <textarea id="textarea"></textarea> |
| 6 <div id="log"></div> | 6 <div id="log"></div> |
| 7 <script> | 7 <script> |
| 8 textarea = document.getElementById("textarea"); | 8 textarea = document.getElementById("textarea"); |
| 9 textarea.setSelectionRange(0, 0); | 9 textarea.setSelectionRange(0, 0); |
| 10 textarea.focus(); |
| 10 textarea.parentNode.removeChild(textarea); | 11 textarea.parentNode.removeChild(textarea); |
| 11 test(function() { | 12 test(function() { |
| 12 assert_equals(window.getSelection().type, 'Caret'); | 13 assert_equals(window.getSelection().type, 'Caret'); |
| 13 assert_equals(window.getSelection().getRangeAt(0).startContainer, document.b
ody); | 14 assert_equals(window.getSelection().getRangeAt(0).startContainer, document.b
ody); |
| 14 assert_equals(window.getSelection().getRangeAt(0).startOffset, 2); | 15 assert_equals(window.getSelection().getRangeAt(0).startOffset, 2); |
| 15 }); | 16 }); |
| 16 </script> | 17 </script> |
| OLD | NEW |