upload tizen1.0 source
[framework/web/webkit-efl.git] / LayoutTests / editing / execCommand / format-block-table.html
1 <!DOCTYPE html>
2 <html>
3 <body>
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>
7 </div>
8 <div id="test1" contenteditable>
9 <table><tr><td>hello</td><td>world</td></tr></table>
10 </div>
11 <div id="test2" contenteditable>
12 <table><tr><td><p>hello</p><div>world</div></td><td>WebKit</td></tr></table>
13 </div>
14 <div id="test3" contenteditable>
15 <table><tr><td><ul><li>hello</li><li>world</li></ul></td><td>WebKit</td></tr></table>
16 </div>
17 <script>
18
19 function testIndentation(containerId, selector, value) {
20     var container = document.getElementById(containerId);
21     selector(container);
22     Markup.dump(container, 'Formatting');
23     document.execCommand('FormatBlock', false, value);
24     Markup.dump(container, 'by ' + value + ' yields');
25 }
26
27 function selectAll(container) {
28     window.getSelection().selectAllChildren(container);
29 }
30
31 function selectFirstCell(container) {
32     window.getSelection().selectAllChildren(container.getElementsByTagName('td')[0]);
33 }
34
35 testIndentation('test0', selectAll, 'p');
36 testIndentation('test1', selectFirstCell, 'blockquote');
37 testIndentation('test2', selectFirstCell, 'h3');
38 testIndentation('test3', selectFirstCell, 'address');
39
40 </script>
41 </body>
42 </html>