2 Test that moving the caret with line granularity within the highest
3 editable root works across non-editable content.
5 <pre id=
"console"></pre>
6 <div contenteditable=
"true">
7 <div contenteditable=
"false">
8 <span id=
"pie" contenteditable=
"true">apple pie
</span>
10 <div contenteditable=
"false">
13 <div contenteditable=
"false">
14 <span id=
"juice" contenteditable=
"true">apple juice
</span>
20 document
.getElementById("console").appendChild(document
.createTextNode(message
+ "\n"));
23 if (window
.testRunner
)
24 testRunner
.dumpAsText();
27 var pie
= document
.getElementById("pie");
28 var juice
= document
.getElementById("juice");
30 var sel
= getSelection();
31 sel
.collapse(pie
.firstChild
, 3);
32 sel
.modify("move", "forward", "line");
34 if (sel
.anchorNode
!== juice
.firstChild
|| sel
.anchorOffset
!= 3) {
35 log("FAIL: Did not move to the next line");
39 sel
.collapse(juice
.firstChild
, 3);
40 sel
.modify("move", "backward", "line");
42 if (sel
.anchorNode
!== pie
.firstChild
|| sel
.anchorOffset
!= 3) {
43 log("FAIL: Did not move to the previous line");