OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
| 4 <script src="resources/util.js"></script> |
4 <script src="../../fast/js/resources/js-test-pre.js"></script> | 5 <script src="../../fast/js/resources/js-test-pre.js"></script> |
5 </head> | 6 </head> |
6 <body> | 7 <body> |
| 8 <pre id="console"></pre> |
7 <iframe id="frame1" src="data:text/html,<body contenteditable></body>"></iframe> | 9 <iframe id="frame1" src="data:text/html,<body contenteditable></body>"></iframe> |
8 <iframe id="frame2" src="data:text/html,<body contenteditable></body>"></iframe> | 10 <iframe id="frame2" src="data:text/html,<body contenteditable></body>"></iframe> |
9 | 11 |
10 <script> | 12 <script> |
11 | 13 |
12 description("Last word written in an editable in one frame should be " + | 14 description("Last word written in an editable in one frame should be " + |
13 "spellchecked when focusing other frame. To test manually type some " + | 15 "spellchecked when focusing other frame. To test manually type some " + |
14 "misspelled word in one frame and focus other frame. The word should be marked."
); | 16 "misspelled word in one frame and focus other frame. The word should be marked."
); |
15 | 17 |
16 if (window.internals) { | 18 if (window.internals) { |
17 internals.settings.setAsynchronousSpellCheckingEnabled(false); | 19 internals.settings.setAsynchronousSpellCheckingEnabled(false); |
18 | 20 |
19 var frame1 = document.getElementById("frame1"); | 21 var frame1 = document.getElementById("frame1"); |
20 var testEditable1 = frame1.contentWindow.document.createElement("div"); | 22 var testEditable1 = frame1.contentWindow.document.createElement("div"); |
21 testEditable1.setAttribute("contentEditable", "true"); | 23 testEditable1.setAttribute("contentEditable", "true"); |
22 frame1.contentWindow.document.body.appendChild(testEditable1); | 24 frame1.contentWindow.document.body.appendChild(testEditable1); |
23 var frame2 = document.getElementById("frame2"); | 25 var frame2 = document.getElementById("frame2"); |
24 var testEditable2 = frame1.contentWindow.document.createElement("div"); | 26 var testEditable2 = frame1.contentWindow.document.createElement("div"); |
25 testEditable2.setAttribute("contentEditable", "true"); | 27 testEditable2.setAttribute("contentEditable", "true"); |
26 frame2.contentWindow.document.body.appendChild(testEditable2); | 28 frame2.contentWindow.document.body.appendChild(testEditable2); |
27 testEditable1.focus(); | 29 testEditable1.focus(); |
28 frame1.contentWindow.document.execCommand("InsertText", false, "zz"); | 30 frame1.contentWindow.document.execCommand("InsertText", false, "zz"); |
29 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spellin
g")', '0'); | 31 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spellin
g")', '0'); |
30 testEditable2.focus(); | 32 testEditable2.focus(); |
31 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spellin
g")', '1'); | 33 shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spellin
g")', '1'); |
32 } else { | 34 } else { |
33 alert("Automatic testing impossible. Test manually. See steps in the descrip
tion."); | 35 log("Automatic testing impossible. Test manually. See steps in the descripti
on."); |
34 } | 36 } |
35 </script> | 37 </script> |
36 <script src="../../fast/js/resources/js-test-post.js"></script> | 38 <script src="../../fast/js/resources/js-test-post.js"></script> |
37 </body> | 39 </body> |
38 </html> | 40 </html> |
OLD | NEW |