|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <head> |
|
4 <title>Test Word Movement (including nsTextFrame::PeekOffsetWord)</title> |
|
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
8 </head> |
|
9 <body> |
|
10 <p id="display"></p> |
|
11 <div id="content" style="display: block"> |
|
12 <div contentEditable id="editor"></div> |
|
13 </div> |
|
14 <p id="catch">Catch-all |
|
15 <pre id="test"><script class="testbody" type="text/javascript;version=1.7"> |
|
16 |
|
17 /** Tests for bugs 384147 and 981281 **/ |
|
18 |
|
19 SimpleTest.waitForExplicitFinish(); |
|
20 |
|
21 SimpleTest.waitForFocus(function(){setTimeout(focusing, 0)}); |
|
22 |
|
23 function focusing() { |
|
24 document.getElementById("editor").focus(); |
|
25 // This seems to be necessary because the selection is not set up properly otherwise |
|
26 setTimeout(test, 0); |
|
27 } |
|
28 |
|
29 var eatSpace; |
|
30 var stopAtPunctuation; |
|
31 var wordModifiers = |
|
32 (navigator.platform.indexOf("Mac") >= 0) ? {altKey:true} : {ctrlKey:true}; |
|
33 var sel = window.getSelection(); |
|
34 var editor = document.getElementById("editor"); |
|
35 |
|
36 function setPrefs(eat_space, stop_at_punctuation, callback) { |
|
37 eatSpace = eat_space; |
|
38 stopAtPunctuation = stop_at_punctuation; |
|
39 SpecialPowers.pushPrefEnv({"set": [["layout.word_select.eat_space_to_next_word", eat_space], ["layout.word_select.stop_at_punctuation", stop_at_punctuation]]}, callback); |
|
40 } |
|
41 |
|
42 function errString(dir) { |
|
43 return dir + " movement broken with eatSpace=" + eatSpace + |
|
44 ", stopAtPunctuation=" + stopAtPunctuation + " in \"" + editor.innerHTML + |
|
45 "\"; sel.anchorNode.parentNode=" + sel.anchorNode.parentNode; |
|
46 } |
|
47 |
|
48 function testRight(node, offset) { |
|
49 synthesizeKey("VK_RIGHT", wordModifiers); |
|
50 is(sel.anchorNode, node, errString("Right")); |
|
51 is(sel.anchorOffset, offset, errString("Right")); |
|
52 } |
|
53 |
|
54 function testLeft(node, offset) { |
|
55 synthesizeKey("VK_LEFT", wordModifiers); |
|
56 is(sel.anchorNode, node, errString("Left")); |
|
57 is(sel.anchorOffset, offset, errString("Left")); |
|
58 } |
|
59 |
|
60 var afterEditorNode = document.getElementById("catch").firstChild; |
|
61 |
|
62 var ChineseChars = "漢字"; |
|
63 var HiraganaChars = "ひらがな"; |
|
64 var KatakanaChars = "カタカナ"; |
|
65 var JapaneseFullStop = "。"; |
|
66 var JapaneseComma = "、"; |
|
67 |
|
68 function test() { |
|
69 setPrefs(false, true, test1); |
|
70 } |
|
71 |
|
72 function test1() { |
|
73 editor.innerHTML = "Hello Kitty"; |
|
74 sel.collapse(editor.firstChild, 0); |
|
75 testRight(editor.firstChild, 5); |
|
76 testRight(editor.firstChild, 11); |
|
77 testLeft(editor.firstChild, 6); |
|
78 testLeft(editor.firstChild, 0); |
|
79 |
|
80 editor.innerHTML = "<b>Hello</b> Kitty"; |
|
81 sel.collapse(editor.firstChild.firstChild, 0); |
|
82 testRight(editor.firstChild.nextSibling, 0); |
|
83 testRight(editor.firstChild.nextSibling, 6); |
|
84 testLeft(editor.firstChild.nextSibling, 1); |
|
85 testLeft(editor.firstChild.firstChild, 0); |
|
86 |
|
87 editor.innerHTML = "<b>Hello </b>Kitty"; |
|
88 sel.collapse(editor.firstChild.firstChild, 0); |
|
89 testRight(editor.firstChild.firstChild, 5); |
|
90 testRight(editor.firstChild.nextSibling, 5); |
|
91 testLeft(editor.firstChild.firstChild, 6); |
|
92 testLeft(editor.firstChild.firstChild, 0); |
|
93 |
|
94 editor.innerHTML = "<b>Log out</b> roc"; |
|
95 sel.collapse(editor.firstChild.firstChild, 0); |
|
96 testRight(editor.firstChild.firstChild, 3); |
|
97 testRight(editor.firstChild.nextSibling, 0); |
|
98 testRight(editor.firstChild.nextSibling, 5); |
|
99 // In the next test, we expect to be at the end of the |
|
100 // space that is not collapsed away |
|
101 testLeft(editor.firstChild.nextSibling, 1); |
|
102 testLeft(editor.firstChild.firstChild, 4); |
|
103 testLeft(editor.firstChild.firstChild, 0); |
|
104 |
|
105 editor.innerHTML = "http://www.mozilla.org"; |
|
106 sel.collapse(editor.firstChild, 0); |
|
107 testRight(editor.firstChild, 7); |
|
108 testRight(editor.firstChild, 11); |
|
109 testRight(editor.firstChild, 19); |
|
110 testLeft(editor.firstChild, 11); |
|
111 testLeft(editor.firstChild, 7); |
|
112 testLeft(editor.firstChild, 0); |
|
113 |
|
114 editor.innerHTML = "Set .rc to <b>'</b>quiz'"; |
|
115 sel.collapse(editor.firstChild, 0); |
|
116 testRight(editor.firstChild, 3); |
|
117 testRight(editor.firstChild, 7); |
|
118 testRight(editor.firstChild, 10); |
|
119 testRight(editor.firstChild.nextSibling.nextSibling, 5); |
|
120 testLeft(editor.firstChild.nextSibling.firstChild, 1); |
|
121 testLeft(editor.firstChild, 8); |
|
122 testLeft(editor.firstChild, 5); |
|
123 testLeft(editor.firstChild, 0); |
|
124 |
|
125 editor.innerHTML = ChineseChars + HiraganaChars + ChineseChars; |
|
126 sel.collapse(editor.firstChild, 0); |
|
127 testRight(editor.firstChild, 2); |
|
128 testRight(editor.firstChild, 6); |
|
129 testRight(editor.firstChild, 8); |
|
130 testLeft(editor.firstChild, 6); |
|
131 testLeft(editor.firstChild, 2); |
|
132 testLeft(editor.firstChild, 0); |
|
133 |
|
134 editor.innerHTML = ChineseChars + KatakanaChars + ChineseChars; |
|
135 sel.collapse(editor.firstChild, 0); |
|
136 testRight(editor.firstChild, 2); |
|
137 testRight(editor.firstChild, 6); |
|
138 testRight(editor.firstChild, 8); |
|
139 testLeft(editor.firstChild, 6); |
|
140 testLeft(editor.firstChild, 2); |
|
141 testLeft(editor.firstChild, 0); |
|
142 |
|
143 editor.innerHTML = KatakanaChars + HiraganaChars + KatakanaChars; |
|
144 sel.collapse(editor.firstChild, 0); |
|
145 testRight(editor.firstChild, 4); |
|
146 testRight(editor.firstChild, 8); |
|
147 testRight(editor.firstChild, 12); |
|
148 testLeft(editor.firstChild, 8); |
|
149 testLeft(editor.firstChild, 4); |
|
150 testLeft(editor.firstChild, 0); |
|
151 |
|
152 editor.innerHTML = HiraganaChars + JapaneseComma + HiraganaChars + JapaneseFullStop + HiraganaChars; |
|
153 sel.collapse(editor.firstChild, 0); |
|
154 testRight(editor.firstChild, 5); |
|
155 testRight(editor.firstChild, 10); |
|
156 testRight(editor.firstChild, 14); |
|
157 testLeft(editor.firstChild, 10); |
|
158 testLeft(editor.firstChild, 5); |
|
159 testLeft(editor.firstChild, 0); |
|
160 |
|
161 editor.innerHTML = KatakanaChars + JapaneseComma + KatakanaChars + JapaneseFullStop + KatakanaChars; |
|
162 sel.collapse(editor.firstChild, 0); |
|
163 testRight(editor.firstChild, 5); |
|
164 testRight(editor.firstChild, 10); |
|
165 testRight(editor.firstChild, 14); |
|
166 testLeft(editor.firstChild, 10); |
|
167 testLeft(editor.firstChild, 5); |
|
168 testLeft(editor.firstChild, 0); |
|
169 |
|
170 editor.innerHTML = ChineseChars + JapaneseComma + ChineseChars + JapaneseFullStop + ChineseChars; |
|
171 sel.collapse(editor.firstChild, 0); |
|
172 testRight(editor.firstChild, 3); |
|
173 testRight(editor.firstChild, 6); |
|
174 testRight(editor.firstChild, 8); |
|
175 testLeft(editor.firstChild, 6); |
|
176 testLeft(editor.firstChild, 3); |
|
177 testLeft(editor.firstChild, 0); |
|
178 |
|
179 // test basic word movement with eat_space_next_to_word true. |
|
180 setPrefs(true, true, test2); |
|
181 } |
|
182 |
|
183 function test2() { |
|
184 editor.innerHTML = "Hello Kitty"; |
|
185 sel.collapse(editor.firstChild, 0); |
|
186 testRight(editor.firstChild, 6); |
|
187 testRight(editor.firstChild, 11); |
|
188 testLeft(editor.firstChild, 6); |
|
189 testLeft(editor.firstChild, 0); |
|
190 |
|
191 editor.innerHTML = "<b>Hello</b> Kitty"; |
|
192 sel.collapse(editor.firstChild.firstChild, 0); |
|
193 testRight(editor.firstChild.nextSibling, 1); |
|
194 testRight(editor.firstChild.nextSibling, 6); |
|
195 testLeft(editor.firstChild.nextSibling, 1); |
|
196 testLeft(editor.firstChild.firstChild, 0); |
|
197 |
|
198 editor.innerHTML = "<b>Hello </b>Kitty"; |
|
199 sel.collapse(editor.firstChild.firstChild, 0); |
|
200 testRight(editor.firstChild.nextSibling, 0); |
|
201 testRight(editor.firstChild.nextSibling, 5); |
|
202 testLeft(editor.firstChild.firstChild, 6); |
|
203 testLeft(editor.firstChild.firstChild, 0); |
|
204 |
|
205 editor.innerHTML = "<b>Log out</b> roc"; |
|
206 sel.collapse(editor.firstChild.firstChild, 0); |
|
207 testRight(editor.firstChild.firstChild, 4); |
|
208 testRight(editor.firstChild.nextSibling, 2); |
|
209 testRight(editor.firstChild.nextSibling, 5); |
|
210 testLeft(editor.firstChild.nextSibling, 1); |
|
211 testLeft(editor.firstChild.firstChild, 4); |
|
212 testLeft(editor.firstChild.firstChild, 0); |
|
213 |
|
214 editor.innerHTML = "http://www.mozilla.org"; |
|
215 sel.collapse(editor.firstChild, 0); |
|
216 testRight(editor.firstChild, 7); |
|
217 testRight(editor.firstChild, 11); |
|
218 testRight(editor.firstChild, 19); |
|
219 testLeft(editor.firstChild, 11); |
|
220 testLeft(editor.firstChild, 7); |
|
221 testLeft(editor.firstChild, 0); |
|
222 |
|
223 editor.innerHTML = "Set .rc to <b>'</b>quiz'"; |
|
224 sel.collapse(editor.firstChild, 0); |
|
225 testRight(editor.firstChild, 4); |
|
226 testRight(editor.firstChild, 8); |
|
227 testRight(editor.firstChild.nextSibling.firstChild, 0); |
|
228 testRight(editor.firstChild.nextSibling.nextSibling, 5); |
|
229 testLeft(editor.firstChild.nextSibling.firstChild, 1); |
|
230 testLeft(editor.firstChild, 8); |
|
231 testLeft(editor.firstChild, 5); |
|
232 testLeft(editor.firstChild, 0); |
|
233 |
|
234 editor.innerHTML = ChineseChars + HiraganaChars + ChineseChars; |
|
235 sel.collapse(editor.firstChild, 0); |
|
236 testRight(editor.firstChild, 2); |
|
237 testRight(editor.firstChild, 6); |
|
238 testRight(editor.firstChild, 8); |
|
239 testLeft(editor.firstChild, 6); |
|
240 testLeft(editor.firstChild, 2); |
|
241 testLeft(editor.firstChild, 0); |
|
242 |
|
243 editor.innerHTML = ChineseChars + KatakanaChars + ChineseChars; |
|
244 sel.collapse(editor.firstChild, 0); |
|
245 testRight(editor.firstChild, 2); |
|
246 testRight(editor.firstChild, 6); |
|
247 testRight(editor.firstChild, 8); |
|
248 testLeft(editor.firstChild, 6); |
|
249 testLeft(editor.firstChild, 2); |
|
250 testLeft(editor.firstChild, 0); |
|
251 |
|
252 editor.innerHTML = KatakanaChars + HiraganaChars + KatakanaChars; |
|
253 sel.collapse(editor.firstChild, 0); |
|
254 testRight(editor.firstChild, 4); |
|
255 testRight(editor.firstChild, 8); |
|
256 testRight(editor.firstChild, 12); |
|
257 testLeft(editor.firstChild, 8); |
|
258 testLeft(editor.firstChild, 4); |
|
259 testLeft(editor.firstChild, 0); |
|
260 |
|
261 editor.innerHTML = HiraganaChars + JapaneseComma + HiraganaChars + JapaneseFullStop + HiraganaChars; |
|
262 sel.collapse(editor.firstChild, 0); |
|
263 testRight(editor.firstChild, 5); |
|
264 testRight(editor.firstChild, 10); |
|
265 testRight(editor.firstChild, 14); |
|
266 testLeft(editor.firstChild, 10); |
|
267 testLeft(editor.firstChild, 5); |
|
268 testLeft(editor.firstChild, 0); |
|
269 |
|
270 editor.innerHTML = KatakanaChars + JapaneseComma + KatakanaChars + JapaneseFullStop + KatakanaChars; |
|
271 sel.collapse(editor.firstChild, 0); |
|
272 testRight(editor.firstChild, 5); |
|
273 testRight(editor.firstChild, 10); |
|
274 testRight(editor.firstChild, 14); |
|
275 testLeft(editor.firstChild, 10); |
|
276 testLeft(editor.firstChild, 5); |
|
277 testLeft(editor.firstChild, 0); |
|
278 |
|
279 editor.innerHTML = ChineseChars + JapaneseComma + ChineseChars + JapaneseFullStop + ChineseChars; |
|
280 sel.collapse(editor.firstChild, 0); |
|
281 testRight(editor.firstChild, 3); |
|
282 testRight(editor.firstChild, 6); |
|
283 testRight(editor.firstChild, 8); |
|
284 testLeft(editor.firstChild, 6); |
|
285 testLeft(editor.firstChild, 3); |
|
286 testLeft(editor.firstChild, 0); |
|
287 |
|
288 // Test basic word movement with stop_at_punctuation false (bug 981281). |
|
289 setPrefs(false, false, test3); |
|
290 } |
|
291 |
|
292 function test3() { |
|
293 editor.innerHTML = "Hello Kitty"; |
|
294 sel.collapse(editor.firstChild, 0); |
|
295 testRight(editor.firstChild, 5); |
|
296 testRight(editor.firstChild, 11); |
|
297 testLeft(editor.firstChild, 6); |
|
298 testLeft(editor.firstChild, 0); |
|
299 |
|
300 editor.innerHTML = "<b>Hello</b> Kitty"; |
|
301 sel.collapse(editor.firstChild.firstChild, 0); |
|
302 testRight(editor.firstChild.nextSibling, 0); |
|
303 testRight(editor.firstChild.nextSibling, 6); |
|
304 testLeft(editor.firstChild.nextSibling, 1); |
|
305 testLeft(editor.firstChild.firstChild, 0); |
|
306 |
|
307 editor.innerHTML = "<b>Hello </b>Kitty"; |
|
308 sel.collapse(editor.firstChild.firstChild, 0); |
|
309 testRight(editor.firstChild.firstChild, 5); |
|
310 testRight(editor.firstChild.nextSibling, 5); |
|
311 testLeft(editor.firstChild.firstChild, 6); |
|
312 testLeft(editor.firstChild.firstChild, 0); |
|
313 |
|
314 editor.innerHTML = "<b>Log out</b> roc"; |
|
315 sel.collapse(editor.firstChild.firstChild, 0); |
|
316 testRight(editor.firstChild.firstChild, 3); |
|
317 testRight(editor.firstChild.nextSibling, 0); |
|
318 testRight(editor.firstChild.nextSibling, 5); |
|
319 testLeft(editor.firstChild.nextSibling, 1); |
|
320 testLeft(editor.firstChild.firstChild, 4); |
|
321 testLeft(editor.firstChild.firstChild, 0); |
|
322 |
|
323 editor.innerHTML = "http://www.mozilla.org"; |
|
324 sel.collapse(editor.firstChild, 0); |
|
325 testRight(editor.firstChild, 22); |
|
326 testLeft(editor.firstChild, 0); |
|
327 |
|
328 editor.innerHTML = "Set .rc to <b>'</b>quiz'"; |
|
329 sel.collapse(editor.firstChild, 0); |
|
330 testRight(editor.firstChild, 3); |
|
331 testRight(editor.firstChild, 7); |
|
332 testRight(editor.firstChild, 10); |
|
333 testRight(editor.firstChild.nextSibling.nextSibling, 5); |
|
334 testLeft(editor.firstChild, 11); |
|
335 testLeft(editor.firstChild, 8); |
|
336 testLeft(editor.firstChild, 4); |
|
337 testLeft(editor.firstChild, 0); |
|
338 |
|
339 editor.innerHTML = ChineseChars + HiraganaChars + ChineseChars; |
|
340 sel.collapse(editor.firstChild, 0); |
|
341 testRight(editor.firstChild, 2); |
|
342 testRight(editor.firstChild, 6); |
|
343 testRight(editor.firstChild, 8); |
|
344 testLeft(editor.firstChild, 6); |
|
345 testLeft(editor.firstChild, 2); |
|
346 testLeft(editor.firstChild, 0); |
|
347 |
|
348 editor.innerHTML = ChineseChars + KatakanaChars + ChineseChars; |
|
349 sel.collapse(editor.firstChild, 0); |
|
350 testRight(editor.firstChild, 2); |
|
351 testRight(editor.firstChild, 6); |
|
352 testRight(editor.firstChild, 8); |
|
353 testLeft(editor.firstChild, 6); |
|
354 testLeft(editor.firstChild, 2); |
|
355 testLeft(editor.firstChild, 0); |
|
356 |
|
357 editor.innerHTML = KatakanaChars + HiraganaChars + KatakanaChars; |
|
358 sel.collapse(editor.firstChild, 0); |
|
359 testRight(editor.firstChild, 4); |
|
360 testRight(editor.firstChild, 8); |
|
361 testRight(editor.firstChild, 12); |
|
362 testLeft(editor.firstChild, 8); |
|
363 testLeft(editor.firstChild, 4); |
|
364 testLeft(editor.firstChild, 0); |
|
365 |
|
366 editor.innerHTML = HiraganaChars + JapaneseComma + HiraganaChars + JapaneseFullStop + HiraganaChars; |
|
367 sel.collapse(editor.firstChild, 0); |
|
368 testRight(editor.firstChild, 14); |
|
369 testLeft(editor.firstChild, 0); |
|
370 |
|
371 editor.innerHTML = KatakanaChars + JapaneseComma + KatakanaChars + JapaneseFullStop + KatakanaChars; |
|
372 sel.collapse(editor.firstChild, 0); |
|
373 testRight(editor.firstChild, 14); |
|
374 testLeft(editor.firstChild, 0); |
|
375 |
|
376 editor.innerHTML = ChineseChars + JapaneseComma + ChineseChars + JapaneseFullStop + ChineseChars; |
|
377 sel.collapse(editor.firstChild, 0); |
|
378 testRight(editor.firstChild, 8); |
|
379 testLeft(editor.firstChild, 0); |
|
380 |
|
381 // And again with eat_space_next_to_word true. |
|
382 setPrefs(true, false, test4); |
|
383 } |
|
384 |
|
385 function test4() { |
|
386 editor.innerHTML = "Hello Kitty"; |
|
387 sel.collapse(editor.firstChild, 0); |
|
388 testRight(editor.firstChild, 6); |
|
389 testRight(editor.firstChild, 11); |
|
390 testLeft(editor.firstChild, 6); |
|
391 testLeft(editor.firstChild, 0); |
|
392 |
|
393 editor.innerHTML = "<b>Hello</b> Kitty"; |
|
394 sel.collapse(editor.firstChild.firstChild, 0); |
|
395 testRight(editor.firstChild.nextSibling, 1); |
|
396 testRight(editor.firstChild.nextSibling, 6); |
|
397 testLeft(editor.firstChild.nextSibling, 1); |
|
398 testLeft(editor.firstChild.firstChild, 0); |
|
399 |
|
400 editor.innerHTML = "<b>Hello </b>Kitty"; |
|
401 sel.collapse(editor.firstChild.firstChild, 0); |
|
402 testRight(editor.firstChild.nextSibling, 0); |
|
403 testRight(editor.firstChild.nextSibling, 5); |
|
404 testLeft(editor.firstChild.firstChild, 6); |
|
405 testLeft(editor.firstChild.firstChild, 0); |
|
406 |
|
407 editor.innerHTML = "<b>Log out</b> roc"; |
|
408 sel.collapse(editor.firstChild.firstChild, 0); |
|
409 testRight(editor.firstChild.firstChild, 4); |
|
410 testRight(editor.firstChild.nextSibling, 2); |
|
411 testRight(editor.firstChild.nextSibling, 5); |
|
412 testLeft(editor.firstChild.nextSibling, 1); |
|
413 testLeft(editor.firstChild.firstChild, 4); |
|
414 testLeft(editor.firstChild.firstChild, 0); |
|
415 |
|
416 editor.innerHTML = "http://www.mozilla.org"; |
|
417 sel.collapse(editor.firstChild, 0); |
|
418 testRight(editor.firstChild, 22); |
|
419 testLeft(editor.firstChild, 0); |
|
420 |
|
421 editor.innerHTML = "Set .rc to <b>'</b>quiz'"; |
|
422 sel.collapse(editor.firstChild, 0); |
|
423 testRight(editor.firstChild, 4); |
|
424 testRight(editor.firstChild, 8); |
|
425 testRight(editor.firstChild.nextSibling.firstChild, 0); |
|
426 testRight(editor.firstChild.nextSibling.nextSibling, 5); |
|
427 testLeft(editor.firstChild, 11); |
|
428 testLeft(editor.firstChild, 8); |
|
429 testLeft(editor.firstChild, 4); |
|
430 testLeft(editor.firstChild, 0); |
|
431 |
|
432 editor.innerHTML = ChineseChars + HiraganaChars + ChineseChars; |
|
433 sel.collapse(editor.firstChild, 0); |
|
434 testRight(editor.firstChild, 2); |
|
435 testRight(editor.firstChild, 6); |
|
436 testRight(editor.firstChild, 8); |
|
437 testLeft(editor.firstChild, 6); |
|
438 testLeft(editor.firstChild, 2); |
|
439 testLeft(editor.firstChild, 0); |
|
440 |
|
441 editor.innerHTML = ChineseChars + KatakanaChars + ChineseChars; |
|
442 sel.collapse(editor.firstChild, 0); |
|
443 testRight(editor.firstChild, 2); |
|
444 testRight(editor.firstChild, 6); |
|
445 testRight(editor.firstChild, 8); |
|
446 testLeft(editor.firstChild, 6); |
|
447 testLeft(editor.firstChild, 2); |
|
448 testLeft(editor.firstChild, 0); |
|
449 |
|
450 editor.innerHTML = KatakanaChars + HiraganaChars + KatakanaChars; |
|
451 sel.collapse(editor.firstChild, 0); |
|
452 testRight(editor.firstChild, 4); |
|
453 testRight(editor.firstChild, 8); |
|
454 testRight(editor.firstChild, 12); |
|
455 testLeft(editor.firstChild, 8); |
|
456 testLeft(editor.firstChild, 4); |
|
457 testLeft(editor.firstChild, 0); |
|
458 |
|
459 editor.innerHTML = HiraganaChars + JapaneseComma + HiraganaChars + JapaneseFullStop + HiraganaChars; |
|
460 sel.collapse(editor.firstChild, 0); |
|
461 testRight(editor.firstChild, 14); |
|
462 testLeft(editor.firstChild, 0); |
|
463 |
|
464 editor.innerHTML = KatakanaChars + JapaneseComma + KatakanaChars + JapaneseFullStop + KatakanaChars; |
|
465 sel.collapse(editor.firstChild, 0); |
|
466 testRight(editor.firstChild, 14); |
|
467 testLeft(editor.firstChild, 0); |
|
468 |
|
469 editor.innerHTML = ChineseChars + JapaneseComma + ChineseChars + JapaneseFullStop + ChineseChars; |
|
470 sel.collapse(editor.firstChild, 0); |
|
471 testRight(editor.firstChild, 8); |
|
472 testLeft(editor.firstChild, 0); |
|
473 |
|
474 SimpleTest.finish(); |
|
475 } |
|
476 |
|
477 |
|
478 </script></pre> |
|
479 </body> |
|
480 </html> |