Some apps will add subviews to WKWebView, and by the time we add our m_layerHostingView view we might be adding it behind a view that should have been added behind our layer hosting view subview. This recently affected the Spark email app, due to some changes in order of loading delegate calls and when compositing is enabled. From what I can tell we are hitting this now because we sped up loading since Mojave. We are at the mercy of TiledCoreAnimationDrawingArea’s layer flush runloop observer which, which checks for m_needsSendEnterAcceleratedCompositingMode, before waiting a runloop cycle before triggering the message to the UI process to add the WKFlippedView for m_layerHostingView. The didFinishNavigation delegate call, which adds Spark's subview, seems to be happening reliably sooner than it did in Mojave. WebKit always adds the WKFlippedView behind all subviews, so if Spark's subview is added early, then WKFlippedView will be behind Spark's opaque subview. <rdar://problem/55312523>
Created attachment 379068 [details] Patch
Comment on attachment 379068 [details] Patch Clearing flags on attachment: 379068 Committed r250069: <https://trac.webkit.org/changeset/250069>
All reviewed patches have been landed. Closing bug.