Simplify the logic and increase robustness.
Created attachment 457880 [details] Patch
Created attachment 457882 [details] Patch
Created attachment 457886 [details] Patch
rdar://88179874
Comment on attachment 457886 [details] Patch nice!
Committed r293027 (249766@main): <https://commits.webkit.org/249766@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 457886 [details].