Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / spelling / spelling-with-punctuation-selection.html
blobf43b9689e81bd8878977315da88e1564f3e98da5
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script src="resources/util.js"></script>
6 </head>
7 <body>
8 <div id="container">
9 <div id="destination" contentEditable></div>
10 </div>
12 <script>
14 description("Punctuation marks should be treated as whitespace: spelling should ignore them. " +
15 "To test manually, type 'wellcome!', select 'wellcome!', and context-click on the selection. " +
16 "The test succeeds when the context menu has spell check suggestions.");
18 initSpellTest("destination", "wellcome!", function(textNode) {
19 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
20 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
21 shouldBeEqualToString("window.getSelection().toString()", "");
23 // Select the text "wellcome!" with the exclamation mark.
24 var range = document.createRange();
25 range.setStart(textNode, 0);
26 range.setEnd(textNode, 9);
27 window.getSelection().removeAllRanges();
28 window.getSelection().addRange(range);
30 shouldBeEqualToString("window.getSelection().toString()", "wellcome!");
32 // Context click to show the context menu.
33 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
34 var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
35 eventSender.mouseMoveTo(x, y);
36 contextMenuElements = eventSender.contextClick();
37 // Esc key to hide the context menu.
38 eventSender.keyDown("escape", null);
40 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
41 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
42 shouldBeEqualToString("window.getSelection().toString()", "wellcome!");
43 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
44 });
46 </script>
47 </body>
48 </html>