Index: LayoutTests/editing/spelling/markers-input-type-text.html |
diff --git a/LayoutTests/editing/spelling/markers-input-type-text.html b/LayoutTests/editing/spelling/markers-input-type-text.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cf393c4c61270eaecc64fafdb216007f03699796 |
--- /dev/null |
+++ b/LayoutTests/editing/spelling/markers-input-type-text.html |
@@ -0,0 +1,61 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<style> |
+.editing { |
+ border: 2px solid red; |
+ padding: 12px; |
+ font-size: 24px; |
+} |
+</style> |
+<script src="../editing.js"></script> |
+<script src="resources/util.js"></script> |
+<script src="../../fast/js/resources/js-test-pre.js"></script> |
+</head> |
+<body onload="test();"> |
+<textarea id="testTextArea"></textarea><br/> |
+<input type="text" id="testInput" /><br/> |
+<br/> |
+<textarea id="aux"></textarea> |
+<script> |
+description("Markers in text inputs should only be visible if an input is being edited " + |
+"but removing markers from the input must not touch other markers." + |
+"When testing manually type something misspelled in the first textarea, " + |
+"focus the text input and type something with misspellings there too." + |
+"Then focus the second text area. Mispelling marks should be removed from the input" + |
+"but not for the first textarea. Focus the input again - misspelling marks should be restored."); |
+function test() |
+{ |
+ var testTextArea = document.getElementById("testTextArea"); |
+ var testInput = document.getElementById("testInput"); |
+ |
+ if (!window.internals) { |
+ alert("Test manually. See the description for steps"); |
+ return; |
+ } |
+ |
+ internals.settings.setUnifiedTextCheckerEnabled(true); |
+ |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+ typeText(testTextArea, 'zz. '); |
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1'); |
+ |
+ typeText(testInput, 'zz zz zz zz. '); |
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '4'); |
+ |
+ document.getElementById("aux").focus(); |
+ |
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '0'); |
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1'); |
+ |
+ testInput.focus(); |
+ |
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '4'); |
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1'); |
+} |
+</script> |
+<script src="../../fast/js/resources/js-test-post.js"></script> |
+</body> |
+</html> |