<p>
    Test for <a href="rdar://problem/5645813">rdar://problem/5645813</a>.
</p>
<div id="d1">
    Selected text
</div>
<div id="d2">
    YOU SHOULD NOT SEE THIS TEXT
</div>
<div id="d3" style="background: red; width: 50px; height: 50px;">
</div>
<script>
    getSelection().setBaseAndExtent(d1, 0, d2.firstChild, 6);
    d2.style.display = "none";
    document.body.offsetTop;
    d3.style.display = "none";
    d3.parentNode.removeChild(d3);
</script>
