blob: 2e3faad917b0214df81607092ac1d1f3968bf36a [file] [log] [blame]
<script>
if (window.layoutTestController)
layoutTestController.dumpEditingCallbacks();
</script>
<p>This tests find and replace inside an editable iframe. You should see 'A B A B' below. With bug 4462420, you would see 'A B B A'.</p>
<iframe onload="runTest()" src="../resources/contenteditable-iframe-src.html"></iframe>
<script>
function runTest() {
document.body.offsetTop;
var frame = frames[0];
var sel = frame.getSelection();
var doc = frame.document;
sel.setPosition(doc.body, 0);
doc.execCommand("InsertText", false, "A B A");
sel.setPosition(doc.body, 0);
doc.execCommand("FindString", false, "A B");
doc.execCommand("Copy");
doc.execCommand("FindString", false, "A");
doc.execCommand("Paste");
}
</script>