In 10.15 we noticed a regression where WKWebView was not rendering in our application and just shows a blank view. In 10.14.5 WKWebView is rendering with the same code. The issue is that when any subview in your window uses CoreImage filters, it breaks future WKWebView that are added to the window from rendering. I am not sure what change in WebKit caused this to stop working, but I can repro by running the latest WebKit code on my 10.14.5 machine. This does not repro when you change the order and first call -[WKWebView loadRequest:] before adding the web view to the window. NSView *ciLayerView = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 1, 1)]; ciLayerView.wantsLayer = YES; ciLayerView.layerUsesCoreImageFilters = YES; [[self view] addSubview:ciLayerView]; dispatch_async(dispatch_get_main_queue(), ^{ WKWebView *webView = [[WKWebView alloc] initWithFrame:NSMakeRect(100, 100, 400, 400)]; [self.view addSubview:webView]; [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.bing.com"]]]; });
I have debugged this more and found the cause of the regression, it seems the issue is that m_layerHostingMode is never set to LayerHostingMode::InProcess when CI filters are used. Previously the WebKit content process is already started when you add WKWebView to the window, so WebPageProxy::viewDidEnterWindow updates the layer hosting mode. With recent changes, WebPageProxy::dispatchActivityStateChange returns early because no process is started and the layer hosting mode is not set correctly. PageClientImpl::viewLayerHostingMode can get the correct value for the window, but it is just not set correctly on the content process in this scenario. CI filter forces in-proc rendering, WebKit will need to match the layer hosting mode of the window that is hosting it.
<rdar://problem/52705268>
Maybe a regression from the delayed web process launch thing?
I think WebPageProxy::layerHostingModeDidChange() should not early-return if there's no process launched. Or rather, it should, but just before the message send; it should still update m_layerHostingMode, which is sent across in WebPageCreationParameters.
Created attachment 373653 [details] Patch
Does fix it.
Comment on attachment 373653 [details] Patch LGTM too.
I took a quick jaunt through the rest of WebPageProxy and didn't see any other similarly wrong functions.
Comment on attachment 373653 [details] Patch Clearing flags on attachment: 373653 Committed r247227: <https://trac.webkit.org/changeset/247227>
All reviewed patches have been landed. Closing bug.