RESOLVED FIXED 255779
[GLib] Some default values for WebKitSettings properties do not match UnifiedWebPreferences.yaml
https://bugs.webkit.org/show_bug.cgi?id=255779
Summary [GLib] Some default values for WebKitSettings properties do not match Unified...
Adrian Perez
Reported 2023-04-21 05:29:24 PDT
While working on bug #255518 one of the checks I wrote for the API tests was something like this: // Check that enabled status is the same as the declared default. GRefPtr<WebKitSettings> settings = adoptGRef(webkit_settings_new()); for (gsize i = 0; i < allFeaturesCount; i++) { auto* feature = webkit_feature_list_get(allFeatures, i); g_assert(webkit_settings_get_feature_enabled(settings.get(), feature) == webkit_feature_get_default_value(feature)); } This fails for some settings for which the default value declared in the UnifiedWebPreferences.yaml file does not match the default value for the corresponding WebKitSettings property. As en example: # From UnifiedWebPreferences.yaml EncryptedMediaAPIEnabled: type: bool status: embedder condition: ENABLE(ENCRYPTED_MEDIA) defaultValue: WebKitLegacy: default: false WebKit: default: true WebCore: default: false // WebKitSettings.cpp sObjProperties[PROP_ENABLE_ENCRYPTED_MEDIA] = g_param_spec_boolean( "enable-encrypted-media", _("Enable EncryptedMedia"), _("Whether EncryptedMedia should be enabled."), FALSE, readWriteConstructParamFlags); Note how the YAML file uses “true” as the default value on the WebKit layer, but then the WebKit GLib API code uses “FALSE” as the default. We should either derive the values at the GLib API layer from the YAML file, or update the YAML file so it reflects the reality imposed by the GLib API code. This would be good make the new API introduced in bug #255518 behave consistently with the existing WebKitSettings properties which happen to control WebKit features.
Attachments
Adrian Perez
Comment 1 2023-04-21 05:29:58 PDT
I will do this as a follow-up after bug #255518 =)
Adrian Perez
Comment 2 2024-06-17 04:59:13 PDT
EWS
Comment 3 2024-06-17 11:31:56 PDT
Committed 280080@main (4ad8749ae961): <https://commits.webkit.org/280080@main> Reviewed commits have been landed. Closing PR #29895 and removing active labels.
Radar WebKit Bug Importer
Comment 4 2024-06-17 11:32:14 PDT
WebKit Commit Bot
Comment 5 2024-06-22 03:15:07 PDT
Re-opened since this is blocked by bug 275776
Philippe Normand
Comment 6 2024-06-28 01:46:52 PDT
EWS
Comment 7 2024-06-28 04:39:27 PDT
Committed 280453@main (ff6ffc06d5f8): <https://commits.webkit.org/280453@main> Reviewed commits have been landed. Closing PR #30262 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.