| <p>This tests selection preservation during an indent operation. The selection should start and end in the same parts of the words 'foo' and 'bar' before and after the indent operation.</p> |
| <div id="div" contenteditable="true"><span id="foo">foo</span><br><span id="bar">bar</span></div> |
| |
| <script> |
| var foo = document.getElementById("foo").firstChild; |
| var bar = document.getElementById("bar").firstChild; |
| var sel = window.getSelection(); |
| sel.setBaseAndExtent(foo, 1, bar, 2); |
| document.execCommand("Indent"); |
| </script> |