| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../resources/js-test.js"></script> | |
| 5 </head> | |
| 6 <body> | |
| 7 <pre id="description"></pre> | |
| 8 <pre id="console"></pre> | |
| 9 <div id="container"> | |
| 10 <div id="destination" contentEditable>food.</div> | |
| 11 </div> | |
| 12 | |
| 13 <script> | |
| 14 description("The spellchecker shouldn't mark substrings of words after pasting."
); | |
| 15 | |
| 16 var sel = window.getSelection(); | |
| 17 var destination = document.getElementById("destination"); | |
| 18 var destinationText = destination.firstChild; | |
| 19 sel.setBaseAndExtent(destinationText, 2, destinationText, 2); | |
| 20 | |
| 21 document.execCommand("InsertHTML", false, "<div>o zz</div><div>fo</div>"); | |
| 22 | |
| 23 if (window.internals) { | |
| 24 // The destination node has multiple text nodes, | |
| 25 // so we need concatenate the marked text. | |
| 26 var texts = destination.childNodes; | |
| 27 var markedText = ""; | |
| 28 for (var i = 0; i < texts.length; ++i) { | |
| 29 var marked = internals.markerRangeForNode(texts[i], "spelling", 0); | |
| 30 if (marked) | |
| 31 markedText += marked.toString() | |
| 32 } | |
| 33 | |
| 34 // The first "foo" isn't checked because it crosses the pasted and base html
. | |
| 35 // See http://webkit.org/b/66450. | |
| 36 shouldBeEqualToString("markedText", "zz"); | |
| 37 } | |
| 38 | |
| 39 </script> | |
| 40 </body> | |
| 41 </html> | |
| OLD | NEW |