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>
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");