Enabling color filter, etc... is broken because [WK2BrowserWindowController didChangeSettings] updates the properties of _webView.configuration.preferences but that's on a copy of WKWebView's _configuration.
Has this changed recently? How did this work at all??
The WKWebViewConfiguration is a copy, that's how WKWebViewConfiguration works. The WKPreferences object inside it should NOT be a copy.
Also, in general you may have to make a new view once you've set a preference, which should work. We aren't super great about invalidating preferences.
(In reply to Tim Horton from comment #2) > The WKWebViewConfiguration is a copy, that's how WKWebViewConfiguration > works. The WKPreferences object inside it should NOT be a copy. (In reply to Tim Horton from comment #3) > Also, in general you may have to make a new view once you've set a > preference, which should work. We aren't super great about invalidating > preferences. Hm... I see what you're saying. Back to the original problem.
Hm... maybe there is a race condition between when WebContent process is created & when WebPageProxy::preferencesDidChange() gets called. In particular, when hasRunningProcess() is false, we exit early without sending any IPC even if we're in the middle of starting a new web content process.
_webView->_impl->page().hasRunningProcess() is still false after: _webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:_configuration]
(In reply to Ryosuke Niwa from comment #6) > _webView->_impl->page().hasRunningProcess() is still false after: > > _webView = [[WKWebView alloc] initWithFrame:[containerView bounds] > configuration:_configuration] Of course, process doesn't come up till later
(In reply to Tim Horton from comment #7) > (In reply to Ryosuke Niwa from comment #6) > > _webView->_impl->page().hasRunningProcess() is still false after: > > > > _webView = [[WKWebView alloc] initWithFrame:[containerView bounds] > > configuration:_configuration] > > Of course, process doesn't come up till later Right, but by this time, we've already asked WebContent process to be stared with the old configuration / parameters so new WebContent process ends up receiving the stale configuration / preferences when launched. Yet we never notify them of the preference / configuration change we made.