OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style> |
| 5 .editing { |
| 6 border: 2px solid red; |
| 7 padding: 12px; |
| 8 font-size: 24px; |
| 9 } |
| 10 </style> |
| 11 <script src="../editing.js"></script> |
| 12 <script src="resources/util.js"></script> |
| 13 <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 14 </head> |
| 15 <body onload="test();"> |
| 16 <textarea id="testTextArea"></textarea><br/> |
| 17 <input type="text" id="testInput" /><br/> |
| 18 <br/> |
| 19 <textarea id="aux"></textarea> |
| 20 <script> |
| 21 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 "When testing manually type something misspelled in the first textarea, " + |
| 24 "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 "but not for the first textarea. Focus the input again - misspelling marks shoul
d be restored."); |
| 27 function test() |
| 28 { |
| 29 var testTextArea = document.getElementById("testTextArea"); |
| 30 var testInput = document.getElementById("testInput"); |
| 31 |
| 32 if (!window.internals) { |
| 33 alert("Test manually. See the description for steps"); |
| 34 return; |
| 35 } |
| 36 |
| 37 internals.settings.setUnifiedTextCheckerEnabled(true); |
| 38 |
| 39 if (window.testRunner) |
| 40 testRunner.dumpAsText(); |
| 41 |
| 42 typeText(testTextArea, 'zz. '); |
| 43 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe
lling")', '1'); |
| 44 |
| 45 typeText(testInput, 'zz zz zz zz. '); |
| 46 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli
ng")', '4'); |
| 47 |
| 48 document.getElementById("aux").focus(); |
| 49 |
| 50 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli
ng")', '0'); |
| 51 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe
lling")', '1'); |
| 52 |
| 53 testInput.focus(); |
| 54 |
| 55 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli
ng")', '4'); |
| 56 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe
lling")', '1'); |
| 57 } |
| 58 </script> |
| 59 <script src="../../fast/js/resources/js-test-post.js"></script> |
| 60 </body> |
| 61 </html> |
OLD | NEW |