must wrap document if polyfilling ShadowDOM