WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
222999
Need to rationalize preference like settings on the WKWebViewConfiguration that use the WebPreferences infrastructure
https://bugs.webkit.org/show_bug.cgi?id=222999
Summary
Need to rationalize preference like settings on the WKWebViewConfiguration th...
Sam Weinig
Reported
2021-03-09 15:00:42 PST
There is an issue with all the preference like settings on the WKWebViewConfiguration that use the WebPreferences infrastructure to communicate their state. The issue stems from the configuration values updating the value of the shared WebPreferences object, when their intention was really only to affect the one WKWebView they were being used with. As an example: WKWebViewConfiguration *configurationA = [[WKWebViewConfiguration alloc] init]; configuration._colorFilterEnabled = NO; WKWebView *webViewA = [[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configuration]; // At this point, color filter is disable for webViewA. WKWebViewConfiguration *configurationCopy = webViewA.configuration; configurationCopy._colorFilterEnabled = YES; WKWebView *webViewB = [[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configurationCopy]; // At this point, color filter is now enabled for webViewA and webViewB. I think we need to stop updating the shared preferences entirely from [WKWebView _setupPageConfiguration:] and treat each configuration value as immutable for that WKWebView. This will require a bit of reworking.
Attachments
Analysis of the calls in _setupPageConfiguration:
(10.53 KB, text/plain)
2021-03-09 15:48 PST
,
Sam Weinig
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2021-03-09 15:15:27 PST
There are really two problems here. 1) Configuration values can contaminate shared preferences. 2) The semantics of preferences that are exposed both as a configuration property and preferences property are unclear. Not sure if they can be fixed independently yet.
Sam Weinig
Comment 2
2021-03-09 15:48:48 PST
Created
attachment 422769
[details]
Analysis of the calls in _setupPageConfiguration:
Radar WebKit Bug Importer
Comment 3
2021-03-16 16:01:26 PDT
<
rdar://problem/75499036
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug