4 <script src=
"../../resources/js-test.js"></script>
8 <div id=
"src" contenteditable=
"true" spellcheck=
"true"></div><br/>
9 <div id=
"dst" contenteditable=
"true" spellcheck=
"false"></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.');
18 internals
.settings
.setAsynchronousSpellCheckingEnabled(true);
20 // Insert a misspelled word to initialize a spellchecker.
21 var srcNode
= document
.getElementById('src');
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');
37 document
.execCommand('Paste');
38 shouldBecomeDifferent('internals.hasSpellingMarker(document, 0, 2)', 'true', finishJSTest
);