Reland refactoring for <attachment> from r255903
rdar://103000899
Pull request: https://github.com/WebKit/WebKit/pull/7173
Committed 257448@main (0970540b2a22): <https://commits.webkit.org/257448@main> Reviewed commits have been landed. Closing PR #7173 and removing active labels.