Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / extend-forward-after-set-base-and-extent.html
blob0a8a5d2c4b855ed3234ba88ebc782c376750f721
1 <p>A selection created with setBaseAndExtent should be directional</p>
2 <div id="div" contenteditable="true">There should be four characters selected in this sentence.</div>
3 <ul id="console"></ul>
4 <script>
5 function log(str) {
6 document.getElementById("console").innerHTML += str + "<br>";
9 if (window.testRunner) {
10 window.testRunner.dumpAsText();
12 var text = document.getElementById("div").firstChild;
13 var selection = window.getSelection();
15 selection.collapse(text, 0);
16 selection.modify("move", "forward", "character");
18 selection.setBaseAndExtent(text, 5 + 7, text, 5);
19 // Extending this 5 character selection will select 6 characters.
20 testRunner.execCommand("MoveForwardAndModifySelection");
21 var selectedText = selection.toString();
22 var expectedText = "should";
23 if (selectedText != expectedText)
24 log("Failure: Selected text was \"" + selectedText + "\" and should be \"" + expectedText + "\"");
25 else
26 log("Success");
27 } else
28 log("Failure: This test cannot be run manually.")
29 </script>