OLD | NEW |
1 <html> | 1 <!DOCTYPE html> |
2 <head> | 2 <script src="../../resources/testharness.js"></script> |
3 | 3 <script src="../../resources/testharnessreport.js"></script> |
4 <style> | 4 <body> |
5 .editing { | 5 <div contenteditable id="root" class="editing"> |
6 border: 2px solid red; | 6 <div id="span">foo<span class="Apple-tab-span" style="white-space:pre">»</span>b
ar</div> |
7 padding: 12px; | 7 </div> |
8 font-size: 24px; | 8 <div id="log"></div> |
9 } | |
10 .cell { | |
11 padding: 12px; | |
12 font-size: 24px; | |
13 height: 48px; | |
14 } | |
15 </style> | |
16 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script
> | |
17 | 9 |
18 <script> | 10 <script> |
19 | 11 test(function () { |
20 function editingTest() { | 12 var selection = getSelection(); |
21 for (i = 0; i < 4; i++) | 13 selection.collapse(span.firstChild, 0); |
22 moveSelectionForwardByCharacterCommand(); | 14 for (i = 0; i < 4; i++) { |
23 extendSelectionForwardByWordCommand(); | 15 selection.modify("move", "forward", "character"); |
24 } | 16 } |
25 | 17 selection.modify("extend", "forward", "word"); |
26 </script> | 18 assert_equals(selection.anchorNode, span.childNodes[2]); |
27 | 19 assert_equals(selection.anchorOffset, 0); |
28 <title>Editing Test</title> | 20 assert_equals(selection.focusNode, span.childNodes[2]); |
29 </head> | 21 assert_equals(selection.focusOffset, 3); |
30 <body> | 22 }); |
31 <div contenteditable id="root" class="editing"> | |
32 <div id="test">foo<span class="Apple-tab-span" style="white-space:pre">»</span>b
ar</div> | |
33 </div> | |
34 | |
35 <!-- | |
36 Specifically checks test case in bug: | |
37 <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insert
ion point too high after specific steps | |
38 --> | |
39 | |
40 <script> | |
41 runEditingTest(); | |
42 </script> | 23 </script> |
43 | 24 |
44 </body> | 25 </body> |
45 </html> | 26 |
OLD | NEW |