Adopt smart pointers in more Document-related classes.
Pull request: https://github.com/WebKit/WebKit/pull/19357
Committed 269620@main (f22e2c538682): <https://commits.webkit.org/269620@main> Reviewed commits have been landed. Closing PR #19357 and removing active labels.
<rdar://problem/117295493>