<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>255779</bug_id>
          
          <creation_ts>2023-04-21 05:29:24 -0700</creation_ts>
          <short_desc>[GLib] Some default values for WebKitSettings properties do not match UnifiedWebPreferences.yaml</short_desc>
          <delta_ts>2024-06-28 04:39:30 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit API</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=255518</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=275577</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>275776</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adrian Perez">aperez</reporter>
          <assigned_to name="Philippe Normand">philn</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1950322</commentid>
    <comment_count>0</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2023-04-21 05:29:24 -0700</bug_when>
    <thetext>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&lt;WebKitSettings&gt; settings = adoptGRef(webkit_settings_new());
   for (gsize i = 0; i &lt; 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(
          &quot;enable-encrypted-media&quot;,
          _(&quot;Enable EncryptedMedia&quot;),
          _(&quot;Whether EncryptedMedia should be enabled.&quot;),
          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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1950323</commentid>
    <comment_count>1</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2023-04-21 05:29:58 -0700</bug_when>
    <thetext>I will do this as a follow-up after bug #255518 =)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2041650</commentid>
    <comment_count>2</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2024-06-17 04:59:13 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/29895</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2041695</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-06-17 11:31:56 -0700</bug_when>
    <thetext>Committed 280080@main (4ad8749ae961): &lt;https://commits.webkit.org/280080@main&gt;

Reviewed commits have been landed. Closing PR #29895 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2041696</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-06-17 11:32:14 -0700</bug_when>
    <thetext>&lt;rdar://problem/130018124&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2042600</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2024-06-22 03:15:07 -0700</bug_when>
    <thetext>Re-opened since this is blocked by bug 275776</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043540</commentid>
    <comment_count>6</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2024-06-28 01:46:52 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/30262</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043552</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-06-28 04:39:27 -0700</bug_when>
    <thetext>Committed 280453@main (ff6ffc06d5f8): &lt;https://commits.webkit.org/280453@main&gt;

Reviewed commits have been landed. Closing PR #30262 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>