4 <script src="../../resources/dump-as-markup.js"></script>
5 <div id="test0" contenteditable>
6 <table><tr><td>hello</td><td>world</td></tr></table>
8 <div id="test1" contenteditable>
9 <table><tr><td>hello</td><td>world</td></tr></table>
11 <div id="test2" contenteditable>
12 <table><tr><td><p>hello</p><div>world</div></td><td>WebKit</td></tr></table>
14 <div id="test3" contenteditable>
15 <table><tr><td><ul><li>hello</li><li>world</li></ul></td><td>WebKit</td></tr></table>
19 function testIndentation(containerId, selector, value) {
20 var container = document.getElementById(containerId);
22 Markup.dump(container, 'Formatting');
23 document.execCommand('FormatBlock', false, value);
24 Markup.dump(container, 'by ' + value + ' yields');
27 function selectAll(container) {
28 window.getSelection().selectAllChildren(container);
31 function selectFirstCell(container) {
32 window.getSelection().selectAllChildren(container.getElementsByTagName('td')[0]);
35 testIndentation('test0', selectAll, 'p');
36 testIndentation('test1', selectFirstCell, 'blockquote');
37 testIndentation('test2', selectFirstCell, 'h3');
38 testIndentation('test3', selectFirstCell, 'address');