OLD | NEW |
1 <p>This tests to make sure that a br isn't inserted into a tab span during an In
sertLineBreak operation. You can test for its existence with the DOM inspector
or you can look at the render tree.</p> | 1 <p>This tests to make sure that a br isn't inserted into a tab span during an In
sertLineBreak operation. You can test for its existence with the DOM inspector
or you can look at the render tree.</p> |
2 <div id="div" contenteditable="true"> | 2 <div id="div" contenteditable="true"> |
3 <div><span class="Apple-tab-span" style="white-space:pre">» </span>foo</div> | 3 <div><span style="white-space:pre">	</span>foo</div> |
4 <div><span class="Apple-tab-span" style="white-space:pre">» </span>bar</div> | 4 <div><span style="white-space:pre">	</span>bar</div> |
5 </div> | 5 </div> |
6 | 6 |
7 <script> | 7 <script> |
8 div = document.getElementById("div"); | 8 div = document.getElementById("div"); |
9 div.focus(); | 9 div.focus(); |
10 sel = window.getSelection(); | 10 sel = window.getSelection(); |
11 sel.collapse(div, 0); | 11 sel.collapse(div, 0); |
12 sel.modify("extend", "forward", "paragraph"); | 12 sel.modify("extend", "forward", "paragraph"); |
13 document.execCommand("InsertLineBreak"); | 13 document.execCommand("InsertLineBreak"); |
14 </script> | 14 </script> |
OLD | NEW |