<!DOCTYPE html>
<script>
if (window.testRunner)
    testRunner.dumpAsText();
</script>
<style>
.grid { display: grid; }
.lastBaseline { justify-self: baseline; }
.verticalLR { writing-mode: vertical-rl; }
.content { content: ""; }
</style>
<p>This test PASSES if it does NOT CRASH.</p>
<div class="grid">
   <div class="grid">
      <div id="item" class="lastBaseline verticalLR"></div>
   </div>
</div>
<script>
document.body.offsetLeft;
item.classList.add("content");
</script>

