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

Side by Side Diff: LayoutTests/editing/spelling/markers-input-type-text.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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <style> 4 <style>
5 .editing { 5 .editing {
6 border: 2px solid red; 6 border: 2px solid red;
7 padding: 12px; 7 padding: 12px;
8 font-size: 24px; 8 font-size: 24px;
9 } 9 }
10 </style> 10 </style>
11 <script src="../editing.js"></script> 11 <script src="../editing.js"></script>
12 <script src="resources/util.js"></script> 12 <script src="resources/util.js"></script>
13 <script src="../../fast/js/resources/js-test-pre.js"></script> 13 <script src="../../fast/js/resources/js-test-pre.js"></script>
14 </head> 14 </head>
15 <body onload="test();"> 15 <body onload="test();">
16 <pre id="console"></pre>
16 <textarea id="testTextArea"></textarea><br/> 17 <textarea id="testTextArea"></textarea><br/>
17 <input type="text" id="testInput" /><br/> 18 <input type="text" id="testInput" /><br/>
18 <br/> 19 <br/>
19 <textarea id="aux"></textarea> 20 <textarea id="aux"></textarea>
20 <script> 21 <script>
21 description("Markers in text inputs should only be visible if an input is being edited " + 22 description("Markers in text inputs should only be visible if an input is being edited " +
22 "but removing markers from the input must not touch other markers." + 23 "but removing markers from the input must not touch other markers." +
23 "When testing manually type something misspelled in the first textarea, " + 24 "When testing manually type something misspelled in the first textarea, " +
24 "focus the text input and type something with misspellings there too." + 25 "focus the text input and type something with misspellings there too." +
25 "Then focus the second text area. Mispelling marks should be removed from the in put" + 26 "Then focus the second text area. Mispelling marks should be removed from the in put" +
26 "but not for the first textarea. Focus the input again - misspelling marks shoul d be restored."); 27 "but not for the first textarea. Focus the input again - misspelling marks shoul d be restored.");
27 function test() 28 function test()
28 { 29 {
29 var testTextArea = document.getElementById("testTextArea"); 30 var testTextArea = document.getElementById("testTextArea");
30 var testInput = document.getElementById("testInput"); 31 var testInput = document.getElementById("testInput");
31 32
32 if (!window.internals) { 33 if (!window.internals) {
33 alert("Test manually. See the description for steps"); 34 log("Test manually. See the description for steps.");
34 return; 35 return;
35 } 36 }
36 37
37 internals.settings.setUnifiedTextCheckerEnabled(true); 38 internals.settings.setUnifiedTextCheckerEnabled(true);
38 39
39 if (window.testRunner) 40 if (window.testRunner)
40 testRunner.dumpAsText(); 41 testRunner.dumpAsText();
41 42
42 typeText(testTextArea, 'zz. '); 43 typeText(testTextArea, 'zz. ');
43 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '1'); 44 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '1');
44 45
45 typeText(testInput, 'zz zz zz zz. '); 46 typeText(testInput, 'zz zz zz zz. ');
46 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli ng")', '4'); 47 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli ng")', '4');
47 48
48 document.getElementById("aux").focus(); 49 document.getElementById("aux").focus();
49 50
50 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli ng")', '0'); 51 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli ng")', '0');
51 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '1'); 52 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '1');
52 53
53 testInput.focus(); 54 testInput.focus();
54 55
55 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli ng")', '4'); 56 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli ng")', '4');
56 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '1'); 57 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '1');
57 } 58 }
58 </script> 59 </script>
59 <script src="../../fast/js/resources/js-test-post.js"></script> 60 <script src="../../fast/js/resources/js-test-post.js"></script>
60 </body> 61 </body>
61 </html> 62 </html>
OLDNEW
« no previous file with comments | « LayoutTests/editing/spelling/focusing-other-frame.html ('k') | LayoutTests/editing/spelling/spellcheck-editable-on-focus.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698