9eaba514a7b285ce19a18609653cd17276bdec9b
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / execCommand / find-after-replace.html
1 <body onload="runTest()">
2 <script>
3 if (window.testRunner)
4      testRunner.dumpEditingCallbacks();
5 </script>
6 <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>
7 <iframe src="../resources/contenteditable-iframe-src.html"></iframe>
8
9 <script>
10 function runTest() {
11     document.body.offsetTop;
12
13     var frame = frames[0];
14     var sel = frame.getSelection();
15     var doc = frame.document;
16
17     sel.setPosition(doc.body, 0);
18     doc.execCommand("InsertText", false, "A B A");
19     sel.setPosition(doc.body, 0);
20     doc.execCommand("FindString", false, "A B");
21     doc.execCommand("Copy");
22     doc.execCommand("FindString", false, "A");
23     doc.execCommand("Paste");
24 }
25 </script>
26 </body>