…and use it to remove some duplicated code.
Pull request: https://github.com/WebKit/WebKit/pull/14209
Committed 264436@main (ddb41c0a2bc1): <https://commits.webkit.org/264436@main> Reviewed commits have been landed. Closing PR #14209 and removing active labels.