OLD | NEW |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
1 <script> | 4 <script> |
2 if (window.testRunner) | 5 var tester = async_test('iframe'); |
3 testRunner.dumpEditingCallbacks(); | 6 function runTest() { |
| 7 if (window.internals) |
| 8 internals.settings.setEditingBehavior('win'); |
4 | 9 |
5 function runTest() { | |
6 var frame = frames[0]; | 10 var frame = frames[0]; |
7 var sel = frame.getSelection(); | 11 var selection = frame.getSelection(); |
8 var doc = frame.document; | 12 var doc = frame.document; |
9 | 13 |
10 sel.collapse(doc.body, 0); | 14 selection.collapse(doc.body, 0); |
11 doc.execCommand("InsertText", false, "foo bar baz"); | 15 doc.execCommand('InsertText', false, 'foo bar baz'); |
12 sel.modify("extend", "backward", "word"); | 16 selection.modify('extend', 'backward', 'word'); |
13 doc.execCommand("Copy"); | 17 doc.execCommand('Copy'); |
14 doc.execCommand("Delete"); | 18 doc.execCommand('Delete'); |
15 doc.execCommand("Paste"); | 19 doc.execCommand('Paste'); |
16 if (window.testRunner) | 20 |
17 window.testRunner.notifyDone(); | 21 tester.step(function() { assert_equals(doc.body.innerHTML.replace(/ /,
' ', 'g'), 'foo bar baz'); }); |
| 22 tester.done(); |
18 } | 23 } |
19 | |
20 if (window.testRunner) | |
21 window.testRunner.waitUntilDone(); | |
22 </script> | 24 </script> |
23 <p>This tests copy/delete/paste inside an editable iframe. You should see 'foo
bar baz' below.</p> | 25 <p>This tests copy/delete/paste inside an editable iframe. You should see 'foo
bar baz' below.</p> |
24 <iframe src="../resources/contenteditable-iframe-src.html" onload="runTest();"><
/iframe> | 26 <iframe srcdoc="<body contenteditable></body>" onload="runTest()"></iframe> |
| 27 <div id="log"></div> |
OLD | NEW |