Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / spelling / spellcheck-paste-disabled.html
blob7d53c4cc8e38316c0bc940829e652ee1e14bca9a
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <div>
8 <div id="src" contenteditable="true" spellcheck="true"></div><br/>
9 <div id="dst" contenteditable="true" spellcheck="false"></div>
10 </div>
11 <script language="javascript">
12 description('Test if WebKit does not spellcheck text when pasting text to an element having spellchecking disabled. ' +
13 'To test manually, copy the text "zz apple" and paste it to the textarea. ' +
14 'When "zz" is not marked as misspelled, this test succeeds.');
16 jsTestIsAsync = true;
18 internals.settings.setAsynchronousSpellCheckingEnabled(true);
20 // Insert a misspelled word to initialize a spellchecker.
21 var srcNode = document.getElementById('src');
22 srcNode.focus();
23 document.execCommand("InsertText", false, 'z');
24 document.execCommand("InsertText", false, 'z');
25 document.execCommand("InsertText", false, ' ');
26 document.execCommand("InsertText", false, 'a');
27 document.execCommand("InsertText", false, 'p');
28 document.execCommand("InsertText", false, 'p');
29 document.execCommand("InsertText", false, 'l');
30 document.execCommand("InsertText", false, 'e');
31 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 2)', 'true', function(){});
32 window.getSelection().selectAllChildren(srcNode);
33 document.execCommand('Copy');
35 var dstNode = document.getElementById('dst');
36 dstNode.focus();
37 document.execCommand('Paste');
38 shouldBecomeDifferent('internals.hasSpellingMarker(document, 0, 2)', 'true', finishJSTest);
40 </script>
41 </body>
42 </html>