summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/editing/deleting/smart-editing-disabled-mac.html
blob: 483458357771adc190eec39152794738fac1a8d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<html> 
<head>
<script>

if (window.testRunner) {
    testRunner.dumpAsText();
    internals.settings.setSmartInsertDeleteEnabled(false);
    internals.settings.setSelectTrailingWhitespaceEnabled(true);
}
if (window.internals)
    internals.settings.setEditingBehavior('mac');

function editingTest() {
    var div = document.getElementById("div");
    var sel = window.getSelection();
    
    sel.collapse(div, 0);
    sel.modify("move", "forward", "word");
    sel.modify("move", "forward", "word");
    sel.modify("extend", "backward", "word");
    testRunner.execCommand("DeleteForward");
}

</script>
<title>Editing Test</title> 
</head> 
<body>
This test verifies that smart insert and delete can be disabled at test time.<br>
If viewing in a browser, you should see the words "foo bar baz".<br>
If using a version of testRunner with this functionality, you should see "foo  baz". (two spaces between the words)<br>
If using a version of testRunner without this functionality, you should see "foo baz". (one space between the words)<br>
</div>
</div>

<div contenteditable="true" id="div">
foo bar baz     
</div>

<script>
editingTest();
</script>

</body>
</html>