Bug 207613
Summary: | Can't enable color filter in MiniBrowser | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | WebKit Misc. | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | achristensen, beidson, cdumez, sihui_liu, simon.fraser, thorton, wenson_hsieh |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ryosuke Niwa
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
Has this changed recently? How did this work at all??
Tim Horton
The WKWebViewConfiguration is a copy, that's how WKWebViewConfiguration works. The WKPreferences object inside it should NOT be a copy.
Tim Horton
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.
Ryosuke Niwa
(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.
Ryosuke Niwa
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.
Ryosuke Niwa
_webView->_impl->page().hasRunningProcess() is still false after:
_webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:_configuration]
Tim Horton
(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
Ryosuke Niwa
(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.