3 <p id=
"description"></p>
4 <div id=
"sample" contenteditable=
"true">Foo
</div>
5 <iframe id=
"iframe"></iframe>
7 <div id=
"console"></div>
8 <script src=
"../../resources/js-test.js"></script>
10 description('Check we can undo after removing iframe.');
11 function $(id
) { return document
.getElementById(id
); }
13 var doc
= $('iframe').contentDocument
;
14 doc
.designMode
= 'on';
15 doc
.execCommand('SelectAll');
16 doc
.execCommand('InsertHTML', false, 'ONE<iframe id="iframe1"></iframe>');
18 window
.getSelection().collapse($('sample'), 0);
19 document
.execCommand('InsertHTML', false, 'One');
20 document
.execCommand('InsertHTML', false, 'Two');
21 document
.execCommand('InsertHTML', false, 'Three');
23 doc
.execCommand('InsertHTML', false, 'TWO<iframe id="iframe2"></iframe>');
24 doc
.execCommand('InsertHTML', false, 'THREE<iframe id="iframe3"></iframe>');
25 doc
.execCommand('Undo'); // Undo 'THREE'; remove IFRAME
26 doc
.execCommand('Undo'); // Undo 'TWO'; remove IFRAME
27 shouldBeEqualToString('doc.body.innerHTML', 'ONE<iframe id="iframe1"></iframe>');
29 document
.execCommand('Undo'); // Undo 'Three'
32 document
.execCommand('Undo'); // Undo 'Two'
33 shouldBeEqualToString('$("sample").textContent', 'OneFoo');
35 if (window
.testRunner
)
36 $('container').outerHTML
= '';