| 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 <div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: s
pace; -khtml-line-break: after-white-space;"> | 4 <script src="../assert_selection.js"></script> |
| 5 <div style="border: none; height: 12px"></div> | 5 <div id="log"></div> |
| 6 <span id="test">foo</span><br>bar | |
| 7 </div> | |
| 8 <script src="../../resources/dump-as-markup.js"></script> | |
| 9 <script> | 6 <script> |
| 10 | 7 test(() => assert_selection( |
| 11 if (window.testRunner) | 8 [ |
| 12 testRunner.dumpEditingCallbacks(); | 9 '<div contenteditable>', |
| 13 | 10 '<div style="height: 12px"></div>', |
| 14 var root = document.getElementById('root'); | 11 'foo<br>|bar', |
| 15 root.focus(); | 12 '</div>', |
| 16 window.getSelection().collapse(document.getElementById('test'), 0); | 13 ].join(''), |
| 17 | 14 selection => { |
| 18 for (i = 0; i < 4; i++) | 15 selection.document.execCommand('delete'); |
| 19 window.getSelection().modify('move', 'forward', 'character'); | 16 selection.document.execCommand('insertParagraph'); |
| 20 | 17 selection.document.execCommand('insertParagraph'); |
| 21 document.execCommand('Delete'); | 18 }, |
| 22 document.execCommand('InsertParagraph'); | 19 [ |
| 23 document.execCommand('InsertParagraph'); | 20 '<div contenteditable>', |
| 24 | 21 '<div style="height: 12px"></div>', |
| 25 Markup.description('Test inserting paragraphs: should see "foo", then an empty l
ine, then "bar" in the next line.\n'+ | 22 'foo<div><br></div>', |
| 26 'Fix for this bug: <rdar://problem/3924579> REGRESSION (Mail): After deleting, h
itting return key does not insert visible newline'); | 23 '<div>|bar</div>', |
| 27 Markup.dump(root); | 24 '</div>', |
| 28 | 25 ].join('')), |
| 26 'Insert visible newline after deleting'); |
| 29 </script> | 27 </script> |
| 30 </body> | |
| 31 </html> | |
| OLD | NEW |