<div id="description">This tests for a bug where FormatBlock in a p element would leave one letter with the wrong style.</div>
<div id="edit" contentEditable="true"><p>This should be in a p element.</p><p id="p">This should be in an H2.</p></div>

<script>
if (window.testRunner)
    window.testRunner.dumpAsText();
    
p = document.getElementById("p");
s = window.getSelection();
s.setPosition(p, 0);

document.execCommand("FormatBlock", false, "h2");
if (window.testRunner)
    document.body.innerText = document.getElementById("description").innerText + "\n\n" + document.getElementById("edit").innerHTML;
</script>
