Rebase the change from PR #3776 (21ad0bc2f1) while preserving current document-identity and host-version tests.
Review-support branch for the original contributor: the author-disabled maintainer-edit setting prevents updating the original PR directly.