<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script src="resources/util.js"></script>
</head>
<body>
<div id="container">
  <div id="destination" contentEditable></div>
</div>

<script>

description("Punctuation marks should be treated as whitespace: spelling should ignore them. "
    + "To test manually, type 'wellcome!' and select 'wellcome!'. "
    + "The test succeeds when 'wellcome' has spelling marker.");

initSpellTest("destination", "welllcome!", function(textNode) {
    spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
    shouldBeEqualToString("spellingMarkerRange.toString()", "welllcome");
    shouldBeEqualToString("window.getSelection().toString()", "");

    // Select the text "wellcome!" with the exclamation mark.
    var range = document.createRange();
    range.setStart(textNode, 0);
    range.setEnd(textNode, 10);
    window.getSelection().removeAllRanges();
    window.getSelection().addRange(range);

    shouldBeEqualToString("window.getSelection().toString()", "welllcome!");

    spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
    shouldBecomeEqualToString("spellingMarkerRange.toString()", "welllcome", finishJSTest);
});

</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
