4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
5 <link rel=
"stylesheet" type=
"text/css" href=
"resources/extend-selection.css" />
7 .fix_width {font-size:
10px; font-family: sans-serif;}
9 <script src=
"resources/move-by-word-visually.js"></script>
20 if (window
.testRunner
&& window
.internals
) {
21 testRunner
.dumpAsText();
22 internals
.settings
.setEditingBehavior('win');
27 <div id=
"testMoveByWord">
29 Title saves the word breaks.
30 The format of title is "xxx|xxxx".
32 The sequence on the left of "|" is word boundaries when moving caret from left to right.
33 The sequence on the right of "|" is word boundaries when moving caret from right to left.
35 If there is a single node in the line, the sequence are offsets.
36 If there are multiple nodes in the line, the sequence is array of [anchor_node_id, offset, child_node_index],
37 where child_node_index is optional, default is the first child of the anchor node.
40 <!-- test multispaces -->
41 <div dir=ltr
class=
"test_move_by_word" title=
"0 4 8 15 18|18 15 8 4 0" contenteditable
>abc def hij opq
</div>
42 <div dir=ltr
class=
"test_move_by_word" title=
"4 8 15 22 28|28 22 15 8 4" contenteditable
> abc def hij opq
</div>
43 <div dir=ltr
class=
"test_move_by_word" title=
"4 8 15 21|21 15 8 4" contenteditable
> abc אבצ def
</div>
44 <div dir=ltr
class=
"test_move_by_word" title=
"4 8 15 21 29 36 42|42 36 29 21 15 8 4" contenteditable
> abc def אבצ דדפ hij opq
</div>
45 <div dir=ltr
class=
"test_move_by_word" title=
"4 8 15 22 35 28 43 50 57 63|63 57 50 43 28 35 22 15 8 4" contenteditable
> abc def hij אבצ דעפ היח opq rst uvw
</div>
46 <div dir=ltr
class=
"test_move_by_word" title=
"4 21 14 7 28|28 7 14 21 4" contenteditable
> אבצ דעפ חיח ופק
</div>
47 <div dir=ltr
class=
"test_move_by_word" title=
"4 8 15 21|21 15 8 4" contenteditable
> אבצ abc דעפ
</div>
48 <div dir=ltr
class=
"test_move_by_word" title=
"4 7 15 22 28 33 40|40 33 28 22 15 7 4" contenteditable
> אבצ דעפ abc def חיח ופק
</div>
49 <div dir=ltr
class=
"test_move_by_word" title=
"4 14 7 22 29 35 41 51 46 58|58 46 51 41 35 29 22 7 14 4" contenteditable
> אבצ דעפ חיח abc def jih ופק ופק רסת
</div>
51 <div dir=ltr
class=
"test_move_by_word" title=
"0 14 7 3 18|18 3 7 14 0" contenteditable
>אבצ דעפ היח ופק
</div>
52 <div dir=ltr
class=
"test_move_by_word" title=
"0 7 3 12 19 23 26|26 23 19 12 3 7 0" contenteditable
>אבצ דעפ היח abc def hij
</div>
53 <div dir=ltr
class=
"test_move_by_word" title=
"0 4 8 12 22 18 27 34 38 41|41 38 34 27 18 22 12 8 4 0" contenteditable
>abc def hij אבצ דעפ היח opq rst uvw
</div>
55 <div dir=rtl
class=
"test_move_by_word" title=
"18 3 7 14 0|0 14 7 3 18" contenteditable
>abc def hij opq
</div>
56 <div dir=rtl
class=
"test_move_by_word" title=
"28 7 14 21 4|4 21 14 7 28" contenteditable
> abc def hij opq
</div>
57 <div dir=rtl
class=
"test_move_by_word" title=
"21 15 8 4|4 8 15 21" contenteditable
> abc אבצ def
</div>
58 <div dir=rtl
class=
"test_move_by_word" title=
"42 35 29 22 15 7 4|4 7 15 22 29 35 42" contenteditable
> abc def אבצ דדפ hij opq
</div>
59 <div dir=rtl
class=
"test_move_by_word" title=
"63 49 56 43 36 29 22 7 14 4|4 14 7 22 29 36 43 56 49 63" contenteditable
> abc def hij אבצ דעפ היח opq rst uvw
</div>
60 <div dir=rtl
class=
"test_move_by_word" title=
"28 22 15 8 4|4 8 15 22 28" contenteditable
> אבצ דעפ חיח ופק
</div>
61 <div dir=rtl
class=
"test_move_by_word" title=
"21 15 8 4|4 8 15 21" contenteditable
> אבצ abc דעפ
</div>
62 <div dir=rtl
class=
"test_move_by_word" title=
"40 34 28 21 15 8 4|4 8 15 21 28 34 40" contenteditable
> אבצ דעפ abc def חיח ופק
</div>
63 <div dir=rtl
class=
"test_move_by_word" title=
"58 52 47 41 28 34 22 15 8 4|4 8 15 22 34 28 41 47 52 58" contenteditable
> אבצ דעפ חיח abc def jih ופק ופק רסת
</div>
65 <!-- multispaces while preserving spaces -->
66 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 4 11 15 18|18 15 11 4 0" contenteditable
>abc def hij opq
</div>
67 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 4 11 18 25 32|32 25 18 11 4 0" contenteditable
> abc def hij opq
</div>
68 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 4 11 18 25|25 18 11 4 0" contenteditable
> abc אבצ def
</div>
69 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 4 11 18 21 32 39 46|46 39 32 21 18 11 4 0" contenteditable
> abc def אבצ דדפ hij opq
</div>
70 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 4 11 18 25 35 28 46 53 60 67|67 60 53 46 28 35 25 18 11 4 0" contenteditable
> abc def hij אבצ דעפ היח opq rst uvw
</div>
71 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 4 21 14 7 32|32 7 14 21 4 0" contenteditable
> אבצ דעפ חיח ופק
</div>
72 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 4 11 18 26|26 18 11 4 0" contenteditable
> אבצ abc דעפ
</div>
73 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 4 7 18 24 30 33 44|44 33 30 24 18 7 4 0" contenteditable
> אבצ דעפ abc def חיח ופק
</div>
74 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 4 14 7 25 31 37 43 51 46 63|63 46 51 43 37 31 25 7 14 4 0" contenteditable
> אבצ דעפ חיח abc def jih ופק ופק רסת
</div>
76 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 14 7 3 18|18 3 7 14 0" contenteditable
>אבצ דעפ היח ופק
</div>
77 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 7 3 15 19 23 26|26 23 19 15 3 7 0" contenteditable
>אבצ דעפ היח abc def hij
</div>
78 <div style=
"white-space:pre" dir=ltr
class=
"test_move_by_word" title=
"0 4 8 15 22 18 30 34 38 41|41 38 34 30 18 22 15 8 4 0" contenteditable
>abc def hij אבצ דעפ היח opq rst uvw
</div>
80 <div style=
"white-space:pre" dir=rtl
class=
"test_move_by_word" title=
"18 3 7 14 0|0 14 7 3 18" contenteditable
>abc def hij opq
</div>
81 <div style=
"white-space:pre" dir=rtl
class=
"test_move_by_word" title=
"32 7 14 21 4 0|0 4 21 14 7 32" contenteditable
> abc def hij opq
</div>
82 <div style=
"white-space:pre" dir=rtl
class=
"test_move_by_word" title=
"25 18 11 4 0|0 4 11 18 25" contenteditable
> abc אבצ def
</div>
83 <div style=
"white-space:pre" dir=rtl
class=
"test_move_by_word" title=
"46 35 32 25 18 7 4 0|0 4 7 18 25 32 35 46" contenteditable
> abc def אבצ דדפ hij opq
</div>
84 <div style=
"white-space:pre" dir=rtl
class=
"test_move_by_word" title=
"67 49 56 46 39 32 25 7 14 4 0|0 4 14 7 25 32 39 46 56 49 67" contenteditable
> abc def hij אבצ דעפ היח opq rst uvw
</div>
85 <div style=
"white-space:pre" dir=rtl
class=
"test_move_by_word" title=
"32 25 18 11 4 0|0 4 11 18 25 32" contenteditable
> אבצ דעפ חיח ופק
</div>
86 <div style=
"white-space:pre" dir=rtl
class=
"test_move_by_word" title=
"26 18 11 4 0|0 4 11 18 26" contenteditable
> אבצ abc דעפ
</div>
87 <div style=
"white-space:pre" dir=rtl
class=
"test_move_by_word" title=
"44 37 30 21 18 11 4 0|0 4 11 18 21 30 37 44" contenteditable
> אבצ דעפ abc def חיח ופק
</div>
88 <div style=
"white-space:pre" dir=rtl
class=
"test_move_by_word" title=
"63 55 48 43 28 34 25 18 11 4 0|0 4 11 18 25 34 28 43 48 55 63" contenteditable
> אבצ דעפ חיח abc def jih ופק ופק רסת
</div>
90 <!-- test words not separated by spaces -->
91 <div style=
"white-space:pre" contenteditable dir=ltr
class=
"test_move_by_word" title=
"0 1 2 3 4 9 10 11 17 21 24|24 21 17 11 10 9 4 3 2 1 0">人一氧喝大 笑抬的 abc def
</div>
94 <pre id=
"console"></pre>