Bug 250539 - Web features should be able to bind to JSC Options
Summary: Web features should be able to bind to JSC Options
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: InRadar
Depends on: 247926
Blocks:
  Show dependency treegraph
 
Reported: 2023-01-12 18:18 PST by Elliott Williams
Modified: 2023-01-12 19:56 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Williams 2023-01-12 18:18:41 PST
Currently there is no link between web features (declared in UnifiedWebPreferences.yaml, accessible to WebCore and WebKit) and JavaScriptCore options. These aren't 1:1, but there are some examples of situations where it would be valuable to use feature toggles to A/B test a JSC feature, or use the default values associated with feature status to control JSC's defaults (e.g. turning something on in testing and Safari Technology Preview, but not in stable browsers).

I propose we add an optional "JavaScriptCoreBinding" field to the preference generator, which maps a feature to a JSC option name. At web content process creation time, the UI process can pass these options as environment variables to JSC.

We can't set JSC options after the VM is initialized, so there's no way to wire up the WebCore::Settings machinery to change settings in a running page. But browsers can prompt users to restart or open a new tab. If we wanted to be more heavy-handed, we could do a WebProcessPool::terminateAllWebContentProcesses() to recreate all VMs in response to such a change.
Comment 1 Radar WebKit Bug Importer 2023-01-12 19:56:28 PST
<rdar://problem/104207681>