title: execCommand insertHTML breaks stored window.getSelection()
body: <p>When using methods of selecting text and restoring selected text in a page, I have found that running <code>execCommand('insertHTML...</code> inbetween causes the stored selection to break.</p>
  
  <p>This is a sample of how the text is selected and restored.</p>
  
  <pre><code>// Get Selection
   var sel = window.getSelection().getRangeAt(0);
   // Clear Selections 
   window.getSelection().removeAllRanges();
   // Restore Selection 
   window.getSelection().addRange(sel)
  </code></pre>
  
  <p>This works fine, however once you run <code>execCommand('insertHTML..</code> the selections <code>endOffset</code> sets itself to the same value as the selections <code>startOffset</code></p>
  
  <p>Is there a reason for this? More importantly is there a way round this?</p>
  
  <hr>
  
  <p>A full example of the bug, complete with some basic console logging can be seen here.
  <a href="http://jsfiddle.net/blowsie/Y8pJ7/" rel="nofollow">http://jsfiddle.net/blowsie/Y8pJ7/</a></p>
  
  <p>The objective of this fiddle is to select text , transform it to uppercase and then reselect the text.</p>