OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <script src="../../resources/dump-as-markup.js"></script> |
| 5 <div id="testBlock" contenteditable> |
| 6 <div style="color: green">hello</div> |
| 7 </div> |
| 8 <div id="testBlockWithBR" contenteditable> |
| 9 <div style="color: green"><br></div> |
| 10 </div> |
| 11 <div id="testInline" contenteditable> |
| 12 <span style="color: green">hello</span> |
| 13 </div> |
| 14 <script> |
| 15 function verify(id) |
| 16 { |
| 17 var testElement = document.getElementById(id); |
| 18 window.getSelection().selectAllChildren(testElement); |
| 19 |
| 20 Markup.dump(testElement, 'Before FormatBlock'); |
| 21 document.execCommand('FormatBlock', false, 'h1'); |
| 22 Markup.dump(testElement, 'After FormatBlock'); |
| 23 } |
| 24 Markup.description("This test verifies that formatBlock adds the containing bloc
k element's inline style to the block-style element that replaces it."); |
| 25 |
| 26 verify("testBlock"); |
| 27 verify("testBlockWithBR"); |
| 28 verify("testInline"); |
| 29 |
| 30 </script> |
| 31 </body> |
| 32 </html> |
OLD | NEW |