1 <script src=
"../editing.js"></script>
4 function log(message
) {
5 var console
= document
.getElementById("console");
6 var li
= document
.createElement("li");
7 var text
= document
.createTextNode(message
);
9 console
.appendChild(li
);
13 frames
['iframe'].document
.body
.focus();
15 // Hack to perform the editing command. Should be able to
16 // call execCommand on the main document.
17 frames
['iframe'].document
.execCommand('InsertText', false, 'c');
19 if (frames
['iframe'].document
.body
.innerText
!= 'c') {
20 log("FAIL: could not insert text.");
21 if (window
.testRunner
)
22 testRunner
.notifyDone();
26 if (!document
.queryCommandEnabled('Undo')) {
27 log("FAIL: Undo is not enabled after text insertion.");
28 if (window
.testRunner
)
29 testRunner
.notifyDone();
33 window
.location
= window
.location
.toString() + "?part2";
37 if (frames
['iframe'].document
.body
.innerText
!= '')
38 log("FAIL: subframe still has old content after navigaiton.");
40 if (!document
.queryCommandEnabled('Undo'))
43 log("Failure, Undo was still enabled after the location changed (but at least we didn't crash!)");
45 if (window
.testRunner
)
46 testRunner
.notifyDone();
50 if (window
.location
.toString().indexOf("?part2") == -1) {
57 if (window
.testRunner
) {
58 testRunner
.waitUntilDone();
59 testRunner
.dumpAsText();
64 <body onload=
"runTest()">
65 <iframe name=
"iframe" src=
"../resources/contenteditable-iframe-src.html"></iframe>
66 <ul id=
"console"></ul>