Refactor caret painting logic
radar://104975415
Pull request: https://github.com/WebKit/WebKit/pull/10049
Committed 260775@main (e314f573db05): <https://commits.webkit.org/260775@main> Reviewed commits have been landed. Closing PR #10049 and removing active labels.
Re-opened since this is blocked by bug 252913
Pull request: https://github.com/WebKit/WebKit/pull/10652
Committed 260819@main (36dcac2d8189): <https://commits.webkit.org/260819@main> Reviewed commits have been landed. Closing PR #10652 and removing active labels.