2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / editing / deleting / delete-by-word-002.html
blob05e70c47a2953f4a4aa2ad64147ae75484ef6f2c
1 <html>
2 <head>
4 <style>
5 .editing {
6 border: 2px solid red;
7 font-size: 24px;
9 .explanation {
10 border: 2px solid blue;
11 padding: 12px;
12 font-size: 24px;
13 margin-bottom: 24px;
15 .scenario { margin-bottom: 16px;}
16 .scenario:first-line { font-weight: bold; margin-bottom: 16px;}
17 .expected-results:first-line { font-weight: bold }
18 </style>
19 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
21 <script>
23 function sendDeleteWordKey()
25 var deleteWordModifiers;
26 if (navigator.userAgent.search(/\bMac OS X\b/) != -1)
27 deleteWordModifiers = ["altKey"];
28 else
29 deleteWordModifiers = ["ctrlKey"];
30 if (window.eventSender)
31 eventSender.keyDown(String.fromCharCode(8), deleteWordModifiers);
34 function editingTest()
36 moveSelectionForwardByWordCommand();
37 moveSelectionForwardByWordCommand();
38 sendDeleteWordKey();
39 undoCommand();
42 </script>
44 <title>Editing Test</title>
45 </head>
46 <body>
48 <div class="explanation">
49 <div class="scenario">
50 Tests:
51 <br>
52 Option-delete when no typing command is open, then undo.
53 </div>
54 <div class="expected-results">
55 Expected Results:
56 <br>
57 It should like this, with the word "two" selected:
58 <BR>
59 one two three four
60 </div>
61 </div>
63 <div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;">
64 <div id="test" class="editing">one two three four</div>
65 </div>
67 <script>
68 runEditingTest();
69 </script>
71 </body>
72 </html>