upload tizen1.0 source
[framework/web/webkit-efl.git] / LayoutTests / editing / execCommand / format-block-multiple-paragraphs-in-pre.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/dump-as-markup.js"></script>
5 <div id="test" contenteditable>
6 <pre>
7 hello
8
9 world
10
11 webkit
12 </pre>
13 </div>
14 <script>
15
16 Markup.description('This tests ensures formatBlock removes a pre when formatting multiple paragraphs inside the pre.');
17
18 var test = document.getElementById('test');
19 var original = test.innerHTML;
20 window.getSelection().selectAllChildren(test);
21 document.execCommand('formatBlock', false, 'h3');
22 Markup.dump(test, 'Formatting all paragraphs by h3 yields');
23
24 document.execCommand('undo', false, null);
25 Markup.dump(test, 'Undo yields');
26 window.getSelection().setPosition(test, 0);
27 window.getSelection().modify('extend', 'forward', 'line');
28 window.getSelection().modify('extend', 'forward', 'line');
29 window.getSelection().modify('extend', 'forward', 'line');
30 window.getSelection().modify('extend', 'forward', 'line');
31 document.execCommand('formatBlock', false, 'h3');
32 Markup.dump(test, 'Formatting all but the last paragraph by h3 yields');
33
34 document.execCommand('undo', false, null);
35 Markup.dump(test, 'Undo yields');
36 window.getSelection().setPosition(test, 0);
37 window.getSelection().modify('move', 'forward', 'line');
38 window.getSelection().modify('extend', 'forward', 'line');
39 window.getSelection().modify('extend', 'forward', 'line');
40 window.getSelection().modify('extend', 'forward', 'line');
41 window.getSelection().modify('extend', 'forward', 'line');
42 document.execCommand('formatBlock', false, 'h3');
43 Markup.dump(test, 'Formatting all but the first paragraph by h3 yields');
44
45 </script>
46 </body>
47 </html>