| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!doctype html> |
| 2 <html> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <head> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> | 4 <script src="../assert_selection.js"></script> |
| 5 .editing { | |
| 6 font-size: 24px; | |
| 7 width: 600px; | |
| 8 } | |
| 9 </style> | |
| 10 <title>Editing Test</title> | |
| 11 </head> | |
| 12 <body contenteditable id="root"> | |
| 13 <div id="test" class="editing">one two three</div><div>four five six</div> | |
| 14 <script src="../../resources/dump-as-markup.js"></script> | |
| 15 <script> | 5 <script> |
| 6 test(() => { |
| 7 assert_not_equals(window.testRunner, undefined, |
| 8 'This test requires testRunner.'); |
| 16 | 9 |
| 17 if (!window.testRunner) | 10 assert_selection( |
| 18 document.write("(cannot run interactively)"); | 11 [ |
| 19 else { | 12 '<div contenteditable>', |
| 20 testRunner.dumpEditingCallbacks(); | 13 '<div>|one two three</div>', |
| 14 '<div>four five six</div>', |
| 15 '</div>', |
| 16 ].join(''), |
| 17 selection => { |
| 18 testRunner.execCommand('deleteToEndOfParagraph'); |
| 19 }, |
| 20 [ |
| 21 '<div contenteditable>', |
| 22 '<div>|<br></div><div>four five six</div>', |
| 23 '</div>', |
| 24 ].join(''), |
| 25 '1 Delete a paragraph'); |
| 21 | 26 |
| 22 getSelection().collapse(document.getElementById('test'), 0); | 27 assert_selection( |
| 23 // test for 4570218 by using double deleteToEndOfParagraph | 28 [ |
| 24 testRunner.execCommand("DeleteToEndOfParagraph"); | 29 '<div contenteditable>', |
| 25 testRunner.execCommand("DeleteToEndOfParagraph"); | 30 '<div>|<br></div>', |
| 26 Markup.dump('test'); | 31 '<div>four five six</div>', |
| 27 } | 32 '</div>', |
| 28 | 33 ].join(''), |
| 34 selection => { |
| 35 testRunner.execCommand('deleteToEndOfParagraph'); |
| 36 }, |
| 37 [ |
| 38 '<div contenteditable>', |
| 39 '<div>|four five six</div>', |
| 40 '</div>', |
| 41 ].join(''), |
| 42 '2 Delete an empty paragraph'); |
| 43 }, 'Delete to end of paragraph'); |
| 29 </script> | 44 </script> |
| 30 </body> | |
| 31 </html> | |
| OLD | NEW |