Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / undo / undo-iframe-location-change.html
blob6b7aa2c2a280a7ec6ddfa73c5aaf1b622fb18015
1 <script src="../editing.js"></script>
3 <script>
4 function log(message) {
5 var console = document.getElementById("console");
6 var li = document.createElement("li");
7 var text = document.createTextNode(message);
8 li.appendChild(text);
9 console.appendChild(li);
12 function part1() {
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();
23 return;
26 if (!document.queryCommandEnabled('Undo')) {
27 log("FAIL: Undo is not enabled after text insertion.");
28 if (window.testRunner)
29 testRunner.notifyDone();
30 return;
33 window.location = window.location.toString() + "?part2";
36 function part2() {
37 if (frames['iframe'].document.body.innerText != '')
38 log("FAIL: subframe still has old content after navigaiton.");
40 if (!document.queryCommandEnabled('Undo'))
41 log("Success");
42 else
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();
49 function runTest() {
50 if (window.location.toString().indexOf("?part2") == -1) {
51 part1();
52 } else {
53 part2();
57 if (window.testRunner) {
58 testRunner.waitUntilDone();
59 testRunner.dumpAsText();
62 </script>
64 <body onload="runTest()">
65 <iframe name="iframe" src="../resources/contenteditable-iframe-src.html"></iframe>
66 <ul id="console"></ul>
67 </body>