4 testRunner
.dumpEditingCallbacks();
9 border:
1px solid #aaa;
15 var li
= document
.createElement("li");
16 li
.appendChild(document
.createTextNode(str
));
17 var console
= document
.getElementById("console");
18 console
.appendChild(li
);
21 function assert(bool
) {
30 <body contentEditable=
"true" dir=
"rtl">
31 <p>This tests moving the caret in content of mixed editability with direction RTL. The caret should jump to the next editable region that shares a common editable ancestor when it reaches non-editable content.
</p>
32 <div id=
"e1">editable content
</div>
33 <table cellpadding=
"5" contentEditable=
"false">
35 <td>non-editable content
</td>
36 <td>non-editable content
</td>
37 <td id=
"e2" contentEditable=
"true">editable content
</td>
39 <div id=
"e3">editable content
</div>
41 <ul id=
"console"></ul>
45 if (window
.testRunner
)
46 window
.testRunner
.dumpAsText();
48 var s
= window
.getSelection();
49 var e1
= document
.getElementById("e1");
50 var e2
= document
.getElementById("e2");
51 var e3
= document
.getElementById("e3");
53 s
.collapse(e1
.firstChild
, e1
.firstChild
.length
);
54 s
.modify("move", "forward", "character");
55 s
.modify("move", "forward", "character");
56 assert(s
.anchorNode
== e2
.firstChild
&& s
.anchorOffset
== 0);
58 s
.modify("move", "backward", "character");
59 s
.modify("move", "backward", "character");
60 assert(s
.anchorNode
== e1
.firstChild
&& s
.anchorOffset
== e1
.firstChild
.length
);
62 s
.collapse(e2
.firstChild
, e2
.firstChild
.length
);
63 s
.modify("move", "forward", "character");
64 s
.modify("move", "forward", "character");
65 assert(s
.anchorNode
== e3
.firstChild
&& s
.anchorOffset
== 0);
67 s
.modify("move", "backward", "character");
68 s
.modify("move", "backward", "character");
69 assert(s
.anchorNode
== e2
.firstChild
&& s
.anchorOffset
== e2
.firstChild
.length
)