Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / spelling / spelling-with-whitespace-selection.html
blob17cd5b50004a36e8115a7b64b58858970326c7bb
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("Spelling should ignore whitespace. " +
15 "To test manually, type 'hello, wellcome home.', select ' wellcome ', and context-click on the selection. " +
16 "The test succeeds when the context menu has spell check suggestions.");
18 initSpellTest("destination", "hello, wellcome home.", function(textNode) {
19 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
20 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
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);
29 shouldBeEqualToString("window.getSelection().toString()", " wellcome ");
31 // Context click on " wellcome " to show the context menu.
32 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 80;
33 var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
34 eventSender.mouseMoveTo(x, y);
35 contextMenuElements = eventSender.contextClick();
36 // Esc key to hide the context menu.
37 eventSender.keyDown("escape", null);
39 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
40 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
41 shouldBeEqualToString("window.getSelection().toString()", " wellcome ");
42 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "welcome");
43 });
45 </script>
46 </body>
47 </html>