blob: bc6d7e24aed1f57257e5c3616988628e8a25a4fc [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<p>This tests deleting a node in DOMCharacterDataModified doesn't result in a crash.</p>
<div id="test" contenteditable></div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var test = document.getElementById('test');
test.appendChild(document.createTextNode('a '));
test.appendChild(document.createTextNode(' '));
test.appendChild(document.createTextNode('b'));
test.appendChild(document.createTextNode(' '));
getSelection().setPosition(test.firstChild.nextSibling, 0);
document.body.addEventListener('DOMCharacterDataModified', function () {
test.removeChild(test.firstChild.nextSibling);
if (window.GCController)
GCController.collect();
}, false);
document.execCommand("InsertText", false, "c");
test.textContent = '';
document.writeln('PASS');
</script>
</body>
</html>