| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!doctype html> |
| 2 <html> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <body> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../../resources/dump-as-markup.js"></script> | 4 <script src="../assert_selection.js"></script> |
| 5 <div style="display:inline" contenteditable="true" id="item1"> | |
| 6 Format Me | |
| 7 </div> | |
| 8 | |
| 9 <script> | 5 <script> |
| 10 if (window.testRunner) | 6 test(() => assert_selection( |
| 11 testRunner.dumpEditingCallbacks(); | 7 '<div contenteditable>|Format Me</div>', |
| 12 | 8 'formatBlock <h1>', |
| 13 Markup.description("This test uses FormatBlock with html brackets in the tag str
ing passed to execCommand."); | 9 '<div contenteditable><h1>|Format Me</h1></div>'), |
| 14 | 10 'foramtBlcok accept tag name with html brackets'); |
| 15 Markup.dump("item1", "Before FormatBlock with <h1>"); | |
| 16 | |
| 17 var s = window.getSelection(); | |
| 18 var r = document.createRange(); | |
| 19 var p1 = document.getElementById("item1"); | |
| 20 s.collapse(p1, 0); | |
| 21 document.execCommand("FormatBlock", false, "<h1>"); | |
| 22 | |
| 23 Markup.dump("item1", "After FormatBlock with <h1>"); | |
| 24 | |
| 25 </script> | 11 </script> |
| 26 </body> | |
| 27 </html> | |
| OLD | NEW |