| OLD | NEW |
| 1 <!doctype html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> |
| 1 <script> | 5 <script> |
| 2 if (window.testRunner) | 6 test(() => assert_selection( |
| 3 testRunner.dumpEditingCallbacks(); | 7 [ |
| 8 '<div contenteditable>', |
| 9 '<span>^Lorem</span><br>', |
| 10 'more Lorem!', |
| 11 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px;
">', |
| 12 'ipsum<br>', |
| 13 '<ul>', |
| 14 '<li>Foo</li>', |
| 15 '<li>Bar</li>', |
| 16 '<li>Baz</li>', |
| 17 '</ul>', |
| 18 'Dolor', |
| 19 '</blockquote>', |
| 20 'Sum!<br>', |
| 21 '<span>Thing|</span>', |
| 22 '</div>', |
| 23 ].join(''), |
| 24 'indent', |
| 25 [ |
| 26 '<div contenteditable>', |
| 27 '<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">', |
| 28 '<span>^Lorem<br></span>', |
| 29 'more Lorem!', |
| 30 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 4
0px;">', |
| 31 'ipsum', |
| 32 '</blockquote>', |
| 33 '</blockquote>', |
| 34 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px;
">', |
| 35 '<ul>', |
| 36 '<ul>', |
| 37 '<li>Foo</li>', |
| 38 '<li>Bar</li>', |
| 39 '<li>Baz</li>', |
| 40 '</ul>', |
| 41 '</ul>', |
| 42 '</blockquote>', |
| 43 '<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">', |
| 44 '<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 4
0px;">', |
| 45 'Dolor', |
| 46 '</blockquote>', |
| 47 'Sum!<br>', |
| 48 '<span>Thing|</span>', |
| 49 '</blockquote>', |
| 50 '</div>', |
| 51 ].join('')), |
| 52 'Indent HTML fragment'); |
| 4 </script> | 53 </script> |
| 5 <div id="description"> | |
| 6 This test uses the execCommand to indent the text below. | |
| 7 </div> | |
| 8 <br> | |
| 9 <div contenteditable="true"> | |
| 10 <span id="item1">Lorem</span><br> | |
| 11 more Lorem! | |
| 12 <blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px;"> | |
| 13 ipsum<br> | |
| 14 | |
| 15 <ul> | |
| 16 <li>Foo</li> | |
| 17 <li>Bar</li> | |
| 18 <li>Baz</li> | |
| 19 </ul> | |
| 20 Dolor | |
| 21 </blockquote> | |
| 22 Sum!<br> | |
| 23 <span id="item2">Thing</span> | |
| 24 </div> | |
| 25 <script> | |
| 26 var s = window.getSelection(); | |
| 27 var p1 = document.getElementById("item1"); | |
| 28 var p2 = document.getElementById("item2"); | |
| 29 s.collapse(p1, 0); | |
| 30 s.setBaseAndExtent(p1, 0, p2, 2); | |
| 31 document.execCommand("Indent", false, ""); | |
| 32 </script> | |
| OLD | NEW |