<!DOCTYPE html>
<style>
    .first-letter:first-letter { color: red; }
    span { position: absolute; top: 50px; left: 10px; }
</style>

<q>
    <span>
        <q>Should not crash or assert and all four quotes should be displayed.</q>
    </span>
</q>

<script>
document.body.offsetTop;
document.querySelector("span").className = 'first-letter';
</script>
