| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../fast/js/resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <div id="container"> |
| <div id="destination" contentEditable></div> |
| </div> |
| |
| <script> |
| |
| function done() |
| { |
| layoutTestController.setAsynchronousSpellCheckingEnabled(false); |
| internals.settings.setUnifiedTextCheckingEnabled(false); |
| finishJSTest() |
| } |
| |
| function verify(nretry) |
| { |
| if (!nretry) { |
| done(); |
| return; |
| } |
| |
| var texts = destination.childNodes; |
| markedText = null; |
| for (var i = 0; i < texts.length; ++i) { |
| if (internals.markerCountForNode(texts[i], "spelling")) { |
| markedText = internals.markerRangeForNode(texts[i], "spelling", 0).toString(); |
| markerDescription = internals.markerDescriptionForNode(texts[i], "spelling", 0); |
| break; |
| } |
| } |
| |
| if (markedText != null) { |
| shouldBeEqualToString("markedText", "wellcome"); |
| shouldBeEqualToString("markerDescription", "welcome"); |
| done(); |
| } |
| |
| // Wait until the async spellchecking is done. |
| window.setTimeout(function() { verify(nretry - 1); }, 0); |
| } |
| |
| function test() |
| { |
| jsTestIsAsync = true; |
| internals.settings.setUnifiedTextCheckingEnabled(true); |
| layoutTestController.setAsynchronousSpellCheckingEnabled(true); |
| |
| var sel = window.getSelection(); |
| var destination = document.getElementById("destination"); |
| destination.focus(); |
| document.execCommand("InsertHTML", false, "wellcome"); |
| document.execCommand("InsertText", false, "."); |
| |
| window.setTimeout(function() { verify(10); }, 0); |
| } |
| |
| description("The spellchecker should store replacement text in each marker."); |
| if (window.internals) |
| test(); |
| |
| </script> |
| <script src="../../fast/js/resources/js-test-post.js"></script> |
| </body> |
| </html> |