/a>: Elements must be reattached when inserted/removed from top layer
<p>The test passes if you see a green rectangle stacked on top of a blue rectangle.
<dialog id="bottomDialog"></dialog>
<dialog id="topDialog"></dialog>
<script>
document.getElementById('topDialog').showModal();
var bottomDialog = document.getElementById('bottomDialog');
bottomDialog.showModal();
bottomDialog.offsetTop;  // force a layout
var parent = bottomDialog.parentNode;
parent.removeChild(bottomDialog);
parent.appendChild(bottomDial