OLD | NEW |
1 <head> | 1 <head> |
2 <script> | 2 <script> |
3 if (window.testRunner) | 3 if (window.testRunner) |
4 testRunner.dumpEditingCallbacks(); | 4 testRunner.dumpEditingCallbacks(); |
5 </script> | 5 </script> |
6 | 6 |
7 <style> | 7 <style> |
8 table, td { | 8 table, td { |
9 border: 1px solid #aaa; | 9 border: 1px solid #aaa; |
10 } | 10 } |
11 </style> | 11 </style> |
12 | 12 |
13 <script> | 13 <script> |
14 function log(str) { | 14 function log(str) { |
15 var li = document.createElement("li"); | 15 var li = document.createElement("li"); |
16 li.appendChild(document.createTextNode(str)); | 16 li.appendChild(document.createTextNode(str)); |
17 var console = document.getElementById("console"); | 17 var console = document.getElementById("console"); |
18 console.appendChild(li); | 18 console.appendChild(li); |
19 } | 19 } |
20 | 20 |
21 function assert(bool) { | 21 function assert(bool) { |
22 if (!bool) | 22 if (!bool) |
23 log("Failure"); | 23 log("Failure"); |
24 else | 24 else |
25 log("Success"); | 25 log("Success"); |
26 } | 26 } |
27 </script> | 27 </script> |
28 </head> | 28 </head> |
29 | 29 |
30 <body contentEditable="true"> | 30 <body contentEditable="true" dir="rtl"> |
31 <p>This tests moving the caret in content of mixed editability. The caret shoul
d jump to the next editable region that shares a common editable ancestor when i
t reaches non-editable content.</p> | 31 <p>This tests moving the caret in content of mixed editability with direction RT
L. The caret should jump to the next editable region that shares a common edita
ble ancestor when it reaches non-editable content.</p> |
32 <div id="e1">editable content</div> | 32 <div id="e1">editable content</div> |
33 <table cellpadding="5" contentEditable="false"> | 33 <table cellpadding="5" contentEditable="false"> |
34 <tr> | 34 <tr> |
35 <td>non-editable content</td> | 35 <td>non-editable content</td> |
36 <td>non-editable content</td> | 36 <td>non-editable content</td> |
37 <td id="e2" contentEditable="true">editable content</td> | 37 <td id="e2" contentEditable="true">editable content</td> |
38 </table> | 38 </table> |
39 <div id="e3">editable content</div> | 39 <div id="e3">editable content</div> |
40 | 40 |
41 <ul id="console"></ul> | 41 <ul id="console"></ul> |
(...skipping 19 matching lines...) Expand all Loading... |
61 | 61 |
62 s.collapse(e2.firstChild, e2.firstChild.length); | 62 s.collapse(e2.firstChild, e2.firstChild.length); |
63 s.modify("move", "forward", "character"); | 63 s.modify("move", "forward", "character"); |
64 s.modify("move", "forward", "character"); | 64 s.modify("move", "forward", "character"); |
65 assert(s.anchorNode == e3.firstChild && s.anchorOffset == 0); | 65 assert(s.anchorNode == e3.firstChild && s.anchorOffset == 0); |
66 | 66 |
67 s.modify("move", "backward", "character"); | 67 s.modify("move", "backward", "character"); |
68 s.modify("move", "backward", "character"); | 68 s.modify("move", "backward", "character"); |
69 assert(s.anchorNode == e2.firstChild && s.anchorOffset == e2.firstChild.length) | 69 assert(s.anchorNode == e2.firstChild && s.anchorOffset == e2.firstChild.length) |
70 </script> | 70 </script> |
OLD | NEW |