| OLD | NEW |
| 1 <!doctype HTML> | 1 <!doctype HTML> |
| 2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> | 4 <script src="../assert_selection.js"></script> |
| 5 <script> | 5 <script> |
| 6 test(() => assert_selection( | 6 test(() => assert_selection( |
| 7 '<div contenteditable><p>A|B</p></div>', | 7 '<div contenteditable><p>A|B</p></div>', |
| 8 'insertText \ ', | 8 'insertText \ ', |
| 9 '<div contenteditable><p>A |B</p></div>'), | 9 '<div contenteditable><p>A |B</p></div>'), |
| 10 'insert a plain space in the middle of text node'); | 10 'insert a plain space in the middle of text node'); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 selection => { | 40 selection => { |
| 41 var para = selection.document.getElementById('para'); | 41 var para = selection.document.getElementById('para'); |
| 42 para.appendChild(selection.document.createTextNode('A')); | 42 para.appendChild(selection.document.createTextNode('A')); |
| 43 para.appendChild(selection.document.createTextNode(' B')); | 43 para.appendChild(selection.document.createTextNode(' B')); |
| 44 selection.collapse(para.firstChild, 1); | 44 selection.collapse(para.firstChild, 1); |
| 45 | 45 |
| 46 selection.document.execCommand('insertText', false, ' '); | 46 selection.document.execCommand('insertText', false, ' '); |
| 47 }, | 47 }, |
| 48 '<div contenteditable><p id="para">A\u00A0| B</p></div>'), | 48 '<div contenteditable><p id="para">A\u00A0| B</p></div>'), |
| 49 'Insert a instead of plain space when it is inserted before the text no
de that has a leading plain space'); | 49 'Insert a instead of plain space when it is inserted before the text no
de that has a leading plain space'); |
| 50 |
| 51 test(() => assert_selection( |
| 52 '<div contenteditable>|<br> </div>', |
| 53 selection => { |
| 54 selection.document.execCommand('insertText', false, ' '); |
| 55 selection.document.execCommand('insertText', false, ' '); |
| 56 selection.document.execCommand('insertText', false, ' '); |
| 57 }, |
| 58 '<div contenteditable>\u00A0 \u00A0| </div>'), |
| 59 'Insert spaces into the editable <div> that only has <br> and space as child')
; |
| 50 </script> | 60 </script> |
| OLD | NEW |