summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/editing/spelling/move-cursor-to-misspelled-word.html
blob: 25c11937ca28266a2319f9a1ac5ea98dfed5f47c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<html>
<head>
<script src=../../fast/js/resources/js-test-pre.js language="javascript" type="text/javascript"></script>
<title>Testing moving cursor to a misspelled word</title> 
</head> 
<body>
<div id="src" contenteditable="true" spellcheck="true"></div><br/>
<script language="javascript">
description('Test if Chrome WebKit does not remove a misspelled marker when moving a cursor on a misspelled word.' +
            'To test manually, type a misspelled word "zz " and type a left-arrow key to move the cursor on it.' +
            'This test succeeds when "zz" is marked as misspelled.');

jsTestIsAsync = true;

internals.settings.setAsynchronousSpellCheckingEnabled(true);
var node = document.getElementById('src');
node.focus();
document.execCommand("InsertText", false, 'z');
document.execCommand("InsertText", false, 'z');
document.execCommand("InsertText", false, ' ');
window.getSelection().modify('move', 'backward', 'character');
shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 2)', 'true', finishJSTest);
</script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>