blob: d54e940dab44fc1545712a9f6a2e0488d8dc5269 [file] [log] [blame]
<p>This tests for a crash when adding/removing content from a search field that is inside an editable region.</p>
<div contenteditable="true"><input id="search" type="search"></div>
<ul id="console"></ul>
<script>
function log(msg)
{
li = document.createElement("li");
li.appendChild(document.createTextNode(msg));
document.getElementById("console").appendChild(li);
}
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
var search = document.getElementById("search");
search.setSelectionRange(0, 0);
document.execCommand("InsertText", false, "x");
if (search.value != "x")
log("Failure: text wasn't added to the search field.");
document.execCommand("Delete");
if (search.value == "")
log("Success! Test successfully removed text from the search field.");
</script>