Bug 207613 - Can't enable color filter in MiniBrowser
Summary: Can't enable color filter in MiniBrowser
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-11 20:37 PST by Ryosuke Niwa
Modified: 2020-02-11 22:48 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2020-02-11 20:37:10 PST
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.
Comment 1 Ryosuke Niwa 2020-02-11 20:37:33 PST
Has this changed recently? How did this work at all??
Comment 2 Tim Horton 2020-02-11 20:52:05 PST
The WKWebViewConfiguration is a copy, that's how WKWebViewConfiguration works. The WKPreferences object inside it should NOT be a copy.
Comment 3 Tim Horton 2020-02-11 20:53:47 PST
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.
Comment 4 Ryosuke Niwa 2020-02-11 22:29:12 PST
(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.
Comment 5 Ryosuke Niwa 2020-02-11 22:33:42 PST
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.
Comment 6 Ryosuke Niwa 2020-02-11 22:40:49 PST
_webView->_impl->page().hasRunningProcess() is still false after:

_webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:_configuration]
Comment 7 Tim Horton 2020-02-11 22:46:23 PST
(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
Comment 8 Ryosuke Niwa 2020-02-11 22:48:02 PST
(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.