Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / skip-over-contenteditable.html
blob14c284e844e2cbc7b97bb3bc7c4750e4b9090004
1 <!DOCTYPE HTML>
2 <html>
3 <body>
4 <script src="../../resources/js-test.js"></script>
6 <p id="before">Before the contenteditable</p>
7 <div contentEditable></div>
8 <p id="after">After the contenteditable</p>
10 <div id="console"></div>
11 <script>
12 description("Ensure that extending a selection skips past a contentEditable.");
14 var before = document.getElementById("before");
15 var after = document.getElementById("after");
17 var sel = window.getSelection();
18 sel.setBaseAndExtent(before, 0, before, 6);
19 sel.modify("extend", "forward", "character");
20 shouldBe("sel.focusNode", "after");
22 sel.setBaseAndExtent(after, 5, after, 0);
23 sel.modify("extend", "backward", "character");
24 shouldBe("sel.focusNode.parentElement", "before");
26 sel.setBaseAndExtent(before, 0, before, 6);
27 sel.modify("extend", "forward", "word");
28 shouldBe("sel.focusNode.parentElement", "after");
30 sel.setBaseAndExtent(after, 5, after, 0);
31 sel.modify("extend", "backward", "word");
32 shouldBe("sel.focusNode.parentElement", "before");
34 sel.setBaseAndExtent(before, 0, before, 6);
35 sel.modify("extend", "forward", "line");
36 shouldBe("sel.focusNode.parentElement", "after");
38 sel.setBaseAndExtent(after, 5, after, 0);
39 sel.modify("extend", "backward", "line");
40 shouldBe("sel.focusNode.parentElement", "before");
41 </script>
43 </body>
44 </html>