commit-queue@webkit.org | 0d93acf | 2013-01-31 02:07:58 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
mark.lam@apple.com | 3a182c7 | 2013-09-08 02:36:06 +0000 | [diff] [blame] | 4 | <script src="../../resources/js-test-pre.js"></script> |
commit-queue@webkit.org | 0d93acf | 2013-01-31 02:07:58 +0000 | [diff] [blame] | 5 | <script src="resources/util.js"></script> |
| 6 | </head> |
| 7 | <body> |
| 8 | <div id="container"> |
| 9 | <div id="destination" contentEditable></div> |
| 10 | </div> |
| 11 | |
| 12 | <script> |
| 13 | |
g.czajkowski@samsung.com | b1599d5 | 2014-01-14 07:48:38 +0000 | [diff] [blame] | 14 | description("Spelling should ignore whitespace. " |
| 15 | + "To test manually, type 'hello, wellcome home.', select ' wellcome '. " |
| 16 | + "The test succeeds when 'wellcome' has spelling marker."); |
commit-queue@webkit.org | 0d93acf | 2013-01-31 02:07:58 +0000 | [diff] [blame] | 17 | |
| 18 | initSpellTest("destination", "hello, wellcome home.", function(textNode) { |
| 19 | spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); |
| 20 | shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); |
| 21 | |
| 22 | // Select the text " wellcome " with surrounding whitespace. |
| 23 | var rangeWithWhitespace = document.createRange(); |
| 24 | rangeWithWhitespace.setStart(textNode, 6); |
| 25 | rangeWithWhitespace.setEnd(textNode, 16); |
| 26 | window.getSelection().removeAllRanges(); |
| 27 | window.getSelection().addRange(rangeWithWhitespace); |
| 28 | |
| 29 | shouldBeEqualToString("window.getSelection().toString()", " wellcome "); |
| 30 | |
commit-queue@webkit.org | 0d93acf | 2013-01-31 02:07:58 +0000 | [diff] [blame] | 31 | spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); |
g.czajkowski@samsung.com | b1599d5 | 2014-01-14 07:48:38 +0000 | [diff] [blame] | 32 | shouldBecomeEqualToString("spellingMarkerRange.toString()", "wellcome", finishJSTest); |
commit-queue@webkit.org | 0d93acf | 2013-01-31 02:07:58 +0000 | [diff] [blame] | 33 | }); |
| 34 | |
| 35 | </script> |
mark.lam@apple.com | 3a182c7 | 2013-09-08 02:36:06 +0000 | [diff] [blame] | 36 | <script src="../../resources/js-test-post.js"></script> |
commit-queue@webkit.org | 0d93acf | 2013-01-31 02:07:58 +0000 | [diff] [blame] | 37 | </body> |
| 38 | </html> |