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 '<p>one</p>', |
| 10 '<p><br></p>', |
| 11 '<p><b>two|</b></p>', |
| 12 '<p><br></p>', |
| 13 '<p>three</p>', |
| 14 '</div>', |
| 15 ].join(''), |
| 16 'insertParagraph', |
| 17 [ |
| 18 '<div contenteditable>', |
| 19 '<p>one</p>', |
| 20 '<p><br></p>', |
| 21 '<p><b>two</b></p>', |
| 22 '<p><b>|<br></b></p>', |
| 23 '<p><br></p>', |
| 24 '<p>three</p>', |
| 25 '</div>', |
| 26 ].join('')), |
| 27 'insert BR in B'); |
| 28 |
| 29 test(() => assert_selection( |
| 30 [ |
| 31 '<div contenteditable>', |
| 32 '<p>^one|</p>', |
| 33 '</div>', |
| 34 ].join(''), |
| 35 selection => { |
| 36 selection.document.execCommand('bold'); |
| 37 selection.modify('move', 'forward', 'character'); |
| 38 selection.document.execCommand('insertParagraph'); |
| 39 // Set typing style to non-bold |
| 40 selection.document.execCommand('bold'); |
| 41 selection.document.execCommand('insertText', false, 'abc'); |
| 42 selection.document.execCommand('insertParagraph'); |
| 43 selection.document.execCommand('insertParagraph'); |
| 44 }, |
| 45 [ |
| 46 '<div contenteditable>', |
| 47 '<p><b>one</b></p>', |
| 48 '<p>abc</p>', |
| 49 '<p><br></p>', |
| 50 '<p>|<br></p>', |
| 51 '</div>', |
| 52 ].join('')), |
| 53 'insert BR twice'); |
| 54 </script> |
OLD | NEW |