OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 .editing { | 5 .editing { |
6 border: 2px solid red; | 6 border: 2px solid red; |
7 font-size: 24px; | 7 font-size: 24px; |
8 } | 8 } |
9 .explanation { | 9 .explanation { |
10 border: 2px solid blue; | 10 border: 2px solid blue; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 internals.settings.setEditingBehavior("mac"); | 45 internals.settings.setEditingBehavior("mac"); |
46 | 46 |
47 function sendDeleteWordKey() | 47 function sendDeleteWordKey() |
48 { | 48 { |
49 var deleteWordModifiers; | 49 var deleteWordModifiers; |
50 if (navigator.userAgent.search(/\bMac OS X\b/) != -1) | 50 if (navigator.userAgent.search(/\bMac OS X\b/) != -1) |
51 deleteWordModifiers = ["altKey"]; | 51 deleteWordModifiers = ["altKey"]; |
52 else | 52 else |
53 deleteWordModifiers = ["ctrlKey"]; | 53 deleteWordModifiers = ["ctrlKey"]; |
54 if (window.eventSender) | 54 if (window.eventSender) |
55 eventSender.keyDown(String.fromCharCode(8), deleteWordModifiers); | 55 eventSender.keyDown("backspace", deleteWordModifiers); |
56 debugForDumpAsText("DeleteWord"); | 56 debugForDumpAsText("DeleteWord"); |
57 } | 57 } |
58 | 58 |
59 function editingTest() | 59 function editingTest() |
60 { | 60 { |
61 moveSelectionForwardByWordCommand(); | 61 moveSelectionForwardByWordCommand(); |
62 moveSelectionForwardByWordCommand(); | 62 moveSelectionForwardByWordCommand(); |
63 typeCharacterCommand(' '); | 63 typeCharacterCommand(' '); |
64 typeCharacterCommand('a'); | 64 typeCharacterCommand('a'); |
65 typeCharacterCommand('b'); | 65 typeCharacterCommand('b'); |
66 typeCharacterCommand('c'); | 66 typeCharacterCommand('c'); |
67 sendDeleteWordKey(); | 67 sendDeleteWordKey(); |
68 typeCharacterCommand('c'); | 68 typeCharacterCommand('c'); |
69 typeCharacterCommand('h'); | 69 typeCharacterCommand('h'); |
70 typeCharacterCommand('a'); | 70 typeCharacterCommand('a'); |
71 } | 71 } |
72 | 72 |
73 runDumpAsTextEditingTest(true); | 73 runDumpAsTextEditingTest(true); |
74 </script> | 74 </script> |
75 </body> | 75 </body> |
76 </html> | 76 </html> |
OLD | NEW |