OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <div id="container"> | 4 <div id="container"> |
5 <p id="description"></p> | 5 <p id="description"></p> |
6 <p>To test manually, place the cursor after 'o' in 'word' and delete it characte
r by character. Do ctrl+z. On Mac, 'word' should be selected. On other platforms
'word' should not be selected and the cursor should be placed after 'o' in 'wor
d'.</p> | 6 <p>To test manually, place the cursor after 'o' in 'word' and delete it characte
r by character. Do ctrl+z. On Mac, 'word' should be selected. On other platforms
'word' should not be selected and the cursor should be placed after 'o' in 'wor
d'.</p> |
7 <div id="test" style="border: 2px solid red;" contenteditable>This wo<b>rd </b>s
hould be selected only on mac.</div> | 7 <div id="test" style="border: 2px solid red;" contenteditable>This wo<b>rd </b>s
hould be selected only on mac.</div> |
8 </div> | 8 </div> |
9 <div id="console"></div> | 9 <div id="console"></div> |
10 <script src="../../fast/js/resources/js-test-pre.js"></script> | 10 <script src="../../resources/js-test.js"></script> |
11 <script> | 11 <script> |
12 description('Verifies the selection behavior on undoing a text deletion.'); | 12 description('Verifies the selection behavior on undoing a text deletion.'); |
13 var sampleHTML = 'This wo<b>rd </b>should be selected only on mac.'; | 13 var sampleHTML = 'This wo<b>rd </b>should be selected only on mac.'; |
14 var selectionNode = document.getElementById('test').firstChild; // Text node 'Th
is wo' | 14 var selectionNode = document.getElementById('test').firstChild; // Text node 'Th
is wo' |
15 var selectionOffset = selectionNode.length; | 15 var selectionOffset = selectionNode.length; |
16 var endNodeMac = document.getElementById('test').childNodes[1].firstChild; // Te
xt node 'rd ' | 16 var endNodeMac = document.getElementById('test').childNodes[1].firstChild; // Te
xt node 'rd ' |
17 var endOffsetMac = endNodeMac.length - 1; | 17 var endOffsetMac = endNodeMac.length - 1; |
18 var startOffsetMac = selectionNode.data.indexOf(' ')+1; | 18 var startOffsetMac = selectionNode.data.indexOf(' ')+1; |
19 var selection = window.getSelection(); | 19 var selection = window.getSelection(); |
20 | 20 |
(...skipping 22 matching lines...) Expand all Loading... |
43 undoTest('mac', selectionNode, startOffsetMac, endNodeMac, endOffsetMac, 'wo
rd'); | 43 undoTest('mac', selectionNode, startOffsetMac, endNodeMac, endOffsetMac, 'wo
rd'); |
44 undoTest('win', selectionNode, selectionOffset, selectionNode, selectionOffs
et, ''); | 44 undoTest('win', selectionNode, selectionOffset, selectionNode, selectionOffs
et, ''); |
45 undoTest('unix', selectionNode, selectionOffset, selectionNode, selectionOff
set, ''); | 45 undoTest('unix', selectionNode, selectionOffset, selectionNode, selectionOff
set, ''); |
46 undoTest('android', selectionNode, selectionOffset, selectionNode, selection
Offset, ''); | 46 undoTest('android', selectionNode, selectionOffset, selectionNode, selection
Offset, ''); |
47 } | 47 } |
48 if (window.testRunner) | 48 if (window.testRunner) |
49 document.getElementById('container').outerHTML = ''; | 49 document.getElementById('container').outerHTML = ''; |
50 </script> | 50 </script> |
51 </body> | 51 </body> |
52 </html> | 52 </html> |
OLD | NEW |