Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: LayoutTests/editing/spelling/focusing-other-frame.html

Issue 21694005: Spell check whole content of an editable element when it gets focused. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: style & spurious comment removal. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/spelling/markers-input-type-text.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/spelling/markers-input-type-text.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698