Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / spelling / context-menu-suggestions.html
blob639d7b7d1c6635fb5e50bb59ae7e07647a1d1dcb
1 <body onload="test()">
2 <p>This test checks that spelling suggestions in the context menu are not show when spellcheck="false".
3 To test manually, right click on the text in the input box.</p>
4 <input id="input" spellcheck="false" />
5 <div id="result">FAIL: Did not run test</div>
6 </body>
7 <script>
8 function test()
10 if (window.testRunner)
11 testRunner.dumpAsText();
13 var input = document.getElementById("input");
14 input.focus();
15 document.execCommand("InsertText", false, 'wellcome');
16 document.execCommand("InsertText", false, ' ');
18 var x = input.offsetParent.offsetLeft + input.offsetLeft + 4;
19 var y = input.offsetParent.offsetTop + input.offsetTop + input.offsetHeight / 2;
21 if (!window.eventSender)
22 return;
24 eventSender.mouseMoveTo(x, y);
25 var itemNamesWithoutSpellChecking = eventSender.contextClick();
27 input.setAttribute("spellcheck", "true");
28 eventSender.mouseMoveTo(x, y);
30 var itemNamesWithSpellChecking = eventSender.contextClick();
32 if (itemNamesWithSpellChecking.length > itemNamesWithoutSpellChecking.length)
33 document.getElementById('result').innerHTML = 'SUCCESS';
34 else
35 document.getElementById('result').innerHTML = 'FAILURE: No spell checking suggestions';
37 </script>