| OLD | NEW |
| 1 <!doctype html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> |
| 1 <script> | 5 <script> |
| 2 if (window.testRunner) | 6 test(() => assert_selection( |
| 3 testRunner.dumpEditingCallbacks(); | 7 '<div contenteditable id="div">foo\n<div>bar</div></div>', |
| 8 selection => { |
| 9 var div = selection.document.getElementById("div"); |
| 10 var text = div.firstChild; |
| 11 selection.collapse(text, text.length); |
| 12 }, |
| 13 '<div contenteditable id="div">foo|\n<div>bar</div></div>'), |
| 14 'Visible position creation in unrenderer space after renderer text.'); |
| 4 </script> | 15 </script> |
| 5 <p>This tests visible position creation in unrendered space after rendered text,
just before a new block. The caret should be at the end of the line containing
'foo' because we choose to treat all positions in the unrendered space after 'f
oo' as being visually equivalent to the position just after 'foo', and not visua
lly equivalent to the position on the next line, before 'bar'.</p> | |
| 6 | |
| 7 <div id="div" contenteditable="true">foo | |
| 8 <div>bar</div></div> | |
| 9 | |
| 10 <script> | |
| 11 var s = window.getSelection(); | |
| 12 var div = document.getElementById("div"); | |
| 13 var text = div.firstChild; | |
| 14 | |
| 15 s.collapse(text, text.length); | |
| 16 </script> | |
| 17 | |
| OLD | NEW |