Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / execCommand / format-block-multiple-paragraphs-in-pre.html
blob6c7750bd9fd9332c7581a614d84397ea80a048f5
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
9 world
11 webkit
12 </pre>
13 </div>
14 <script>
16 Markup.description('This tests ensures formatBlock removes a pre when formatting multiple paragraphs inside the pre.');
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');
24 document.execCommand('undo', false, null);
25 Markup.dump(test, 'Undo yields');
26 window.getSelection().collapse(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');
34 document.execCommand('undo', false, null);
35 Markup.dump(test, 'Undo yields');
36 window.getSelection().collapse(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');
45 </script>
46 </body>
47 </html>