Refactor pathFromGraphicsElement.
Pull request: https://github.com/WebKit/WebKit/pull/20620
Committed 270850@main (0296432a0f51): <https://commits.webkit.org/270850@main> Reviewed commits have been landed. Closing PR #20620 and removing active labels.
<rdar://problem/118534262>