blob: 74ba0721ff632580302d2a3f4547e9a92a458c35 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<!DOCTYPE html>
<html>
<body>
<div id="test" contenteditable><button>hello</button></div>
<script src="../../resources/dump-as-markup.js"></script>
<script>
Markup.description('This tests ensures contents inside a button element is properly editable.\n'
+ 'You should see "hello, world WebKit" inside the button and "world" should be bolded.');
var button = document.getElementsByTagName('button')[0];
window.getSelection().collapse(button, 1);
document.execCommand('InsertText', false, ', world WebKit');
window.getSelection().modify('move', 'backward', 'word');
window.getSelection().modify('move', 'backward', 'word');
window.getSelection().modify('extend', 'forward', 'word');
document.execCommand('Bold', false, null);
Markup.dump('test');
</script>
</body>
</html>
|