[Webkit-unassigned] [Bug 255779] New: [GLib] Some default values for WebKitSettings properties do not match UnifiedWebPreferences.yaml

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 21 05:29:24 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=255779

            Bug ID: 255779
           Summary: [GLib] Some default values for WebKitSettings
                    properties do not match UnifiedWebPreferences.yaml
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit API
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: aperez at igalia.com

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230421/1f7a75e6/attachment.htm>


More information about the webkit-unassigned mailing list