The other parts of r238819 has already been reverted in r240808.
Created attachment 361300 [details] Patch
Committed r241026: <https://trac.webkit.org/changeset/241026/webkit>
<rdar://problem/47854046>
After this revert we have a timing out API test: Timeout TestWebKitAPI.RenderingProgress.FirstMeaningfulPaint _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. build: https://build.webkit.org/builders/Apple%20Mojave%20Release%20WK1%20%28Tests%29/builds/2759 verified this locally using run-api-tests on r241026. 241025 does not have the failure.