OLD | NEW |
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> |
16 <pre id="console"></pre> | 16 <pre id="console"></pre> |
17 <textarea id="testTextArea"></textarea><br/> | 17 <textarea id="testTextArea"></textarea><br/> |
18 <input type="text" id="testInput" /><br/> | 18 <input type="text" id="testInput" /><br/> |
19 <br/> | 19 <br/> |
20 <textarea id="aux"></textarea> | 20 <textarea id="aux"></textarea> |
21 <script> | 21 <script> |
22 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 " + |
23 "but removing markers from the input must not touch other markers." + | 23 "but removing markers from the input must not touch other markers." + |
24 "When testing manually type something misspelled in the first textarea, " + | 24 "When testing manually type something misspelled in the first textarea, " + |
25 "focus the text input and type something with misspellings there too." + | 25 "focus the text input and type something with misspellings there too." + |
26 "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" + |
27 "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."); |
28 function test() | |
29 { | |
30 var testTextArea = document.getElementById("testTextArea"); | |
31 var testInput = document.getElementById("testInput"); | |
32 | 28 |
33 if (!window.internals) { | 29 var testTextArea = document.getElementById("testTextArea"); |
34 log("Test manually. See the description for steps."); | 30 var testInput = document.getElementById("testInput"); |
35 return; | |
36 } | |
37 | 31 |
38 internals.settings.setUnifiedTextCheckerEnabled(true); | 32 if (!window.internals) { |
| 33 log("Test manually. See the description for steps."); |
| 34 return; |
| 35 } |
39 | 36 |
40 if (window.testRunner) | 37 internals.settings.setUnifiedTextCheckerEnabled(true); |
41 testRunner.dumpAsText(); | |
42 | 38 |
43 typeText(testTextArea, 'zz. '); | 39 if (window.testRunner) |
44 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe
lling")', '1'); | 40 testRunner.dumpAsText(); |
45 | 41 |
46 typeText(testInput, 'zz zz zz zz. '); | 42 typeText(testTextArea, 'zz. '); |
47 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli
ng")', '4'); | 43 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spellin
g")', '1'); |
48 | 44 |
49 document.getElementById("aux").focus(); | 45 typeText(testInput, 'zz zz zz zz. '); |
| 46 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")
', '4'); |
50 | 47 |
51 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli
ng")', '0'); | 48 document.getElementById("aux").focus(); |
52 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe
lling")', '1'); | |
53 | 49 |
54 testInput.focus(); | 50 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")
', '0'); |
| 51 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spellin
g")', '1'); |
55 | 52 |
56 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli
ng")', '4'); | 53 testInput.focus(); |
57 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe
lling")', '1'); | 54 |
58 } | 55 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")
', '4'); |
| 56 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spellin
g")', '1'); |
59 </script> | 57 </script> |
60 <script src="../../fast/js/resources/js-test-post.js"></script> | 58 <script src="../../fast/js/resources/js-test-post.js"></script> |
61 </body> | 59 </body> |
62 </html> | 60 </html> |
OLD | NEW |