add a self-ref `document`