4 <script src=
"../../resources/js-test.js"></script>
5 <title>Editing a grammatically-incorrect word
</title>
8 <div id=
"src" contenteditable=
"true" spellcheck=
"true"></div><br/>
9 <script language=
"javascript">
10 description('Test if WebKit removes grammar markers when we edit a grammatically-incorrect word. '
11 + 'To test manually, type a grammatically-incorrect sentence "You has the right." and type '
12 + 'a backspace key to delete the last character of "has". '
13 + 'This test succeeds when "ha" does not have grammar markers.');
17 if (window
.internals
) {
18 internals
.settings
.setUnifiedTextCheckerEnabled(true);
19 internals
.settings
.setAsynchronousSpellCheckingEnabled(true);
22 function editAndCheckSentence()
24 // Delete the end of this sentence until it becomes "You ha".
25 for (var i
= 0; i
< 12; ++i
)
26 testRunner
.execCommand("DeleteBackward");
28 shouldBecomeEqual('internals.hasGrammarMarker(document, 4, 2)', 'false', finishJSTest
);
31 var target
= document
.getElementById('src');
33 document
.execCommand("InsertText", false, "You has the right.");
36 shouldBecomeEqual('internals.hasGrammarMarker(document, 4, 3)', 'true', editAndCheckSentence
);