| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> |
| 5 <script> |
| 6 test(() => assert_selection( |
| 7 [ |
| 8 '<div contenteditable>', |
| 9 '|<table><tr><td>foo</td></tr></table>', |
| 10 '</div>', |
| 11 ].join(''), |
| 12 'insertParagraph', |
| 13 [ |
| 14 '<div contenteditable>', |
| 15 '<br>', |
| 16 '|<table><tbody><tr><td>foo</td></tr></tbody></table>', |
| 17 '</div>', |
| 18 ].join('')), |
| 19 'Insert BR before table'); |
| 20 |
| 21 test(() => assert_selection( |
| 22 [ |
| 23 '<div contenteditable>', |
| 24 '<table><tr><td>foo</td></tr></table>', |
| 25 '|bar', |
| 26 '</div>', |
| 27 ].join(''), |
| 28 'insertParagraph', |
| 29 [ |
| 30 '<div contenteditable>', |
| 31 '<table><tbody><tr><td>foo</td></tr></tbody></table>', |
| 32 '<br>', |
| 33 '<div>|bar</div>', |
| 34 '</div>', |
| 35 ].join('')), |
| 36 'Insert BR and enclose with DIV'); |
| 37 |
| 38 test(() => assert_selection( |
| 39 [ |
| 40 '<div contenteditable>', |
| 41 'foo|<hr>bar', |
| 42 '</div>', |
| 43 ].join(''), |
| 44 'insertParagraph', |
| 45 [ |
| 46 '<div contenteditable>', |
| 47 'foo', |
| 48 '<div>|<br><hr>bar</div>', |
| 49 '</div>', |
| 50 ].join('')), |
| 51 'Insert BR before HR'); |
| 52 |
| 53 test(() => assert_selection( |
| 54 [ |
| 55 '<div contenteditable>', |
| 56 'foo<hr>|bar', |
| 57 '</div>', |
| 58 ].join(''), |
| 59 selection => { |
| 60 // Set selection to afterNode(HR) |
| 61 selection.modify('move', 'backward', 'character'); |
| 62 selection.document.execCommand('insertParagraph'); |
| 63 }, |
| 64 [ |
| 65 '<div contenteditable>', |
| 66 'foo<hr>|<br>bar', |
| 67 '</div>', |
| 68 ].join('')), |
| 69 'Insert BR after HR'); |
| 70 |
| 71 test(() => assert_selection( |
| 72 [ |
| 73 '<div contenteditable>', |
| 74 '<a href="http://example.com">|example</a>', |
| 75 '</div>', |
| 76 ].join(''), |
| 77 'insertParagraph', |
| 78 [ |
| 79 '<div contenteditable>', |
| 80 '<div><br></div>', |
| 81 '<a href="http://example.com">|example</a>', |
| 82 '</div>', |
| 83 ].join('')), |
| 84 'Insert DIV+BR before A'); |
| 85 </script> |
| OLD | NEW |