Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / deleting / delete-by-word-001.html
blob67aebc10586a190b06c61e9370474a987239916d
1 <!DOCTYPE html>
2 <html>
3 <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>
20 <title>Editing Test</title>
21 </head>
22 <body>
23 <div class="explanation">
24 <div class="scenario">
25 Tests:
26 <br>
27 Option-delete when a typing command is open.
28 </div>
29 <div class="expected-results">
30 Expected Results:
31 <br>
32 Net result is a third "cha". It should like this:
33 <BR>
34 one two cha cha cha three four cha cha cha
35 </div>
36 </div>
37 <div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;">
38 <div id="test" class="editing">
39 one two cha cha three four cha cha cha
40 </div>
41 </div>
42 <script>
44 if (window.internals)
45 internals.settings.setEditingBehavior("mac");
47 function sendDeleteWordKey()
49 var deleteWordModifiers;
50 if (navigator.userAgent.search(/\bMac OS X\b/) != -1)
51 deleteWordModifiers = ["altKey"];
52 else
53 deleteWordModifiers = ["ctrlKey"];
54 if (window.eventSender)
55 eventSender.keyDown("backspace", deleteWordModifiers);
56 debugForDumpAsText("DeleteWord");
59 function editingTest()
61 moveSelectionForwardByWordCommand();
62 moveSelectionForwardByWordCommand();
63 typeCharacterCommand(' ');
64 typeCharacterCommand('a');
65 typeCharacterCommand('b');
66 typeCharacterCommand('c');
67 sendDeleteWordKey();
68 typeCharacterCommand('c');
69 typeCharacterCommand('h');
70 typeCharacterCommand('a');
73 runDumpAsTextEditingTest(true);
74 </script>
75 </body>
76 </html>