blob: 98f1e50d8f29d21dc724eb5c04bf551b24b42bdd [file] [log] [blame]
<!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.layoutTestController)
window.layoutTestController.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>