<!DOCTYPE html>
<html>
<body>
<p>This tests for a crash when deleting a link inside a text field inside a completely editable document. You shouldn't see anything inside the text field.'<b>We probably shouldn't let users add rich content to text fields even if they are in richly editable regions.'</b></p>
<input type="text" id="textfield">
<script>

if (window.testRunner)
    window.testRunner.dumpAsText();

document.designMode = "on";
var textfield = document.getElementById("textfield");
textfield.setSelectionRange(0, 0);
document.execCommand("CreateLink", false, "http://www.google.com/")
document.execCommand("Delete");
var numberOfElements = document.getElementsByTagName('a').length;
document.write(numberOfElements ? 'FAIL: there were ' + numberOfElements + ' anchor elements but expected none' : 'PASS');
</script>
</body>
</html>
