<?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>275577</bug_id>
          
          <creation_ts>2024-06-17 11:51:57 -0700</creation_ts>
          <short_desc>[WPE][GTK] Toggling a WebKitFeature should notify WebKitSettings properties</short_desc>
          <delta_ts>2024-06-19 14:58:02 -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 Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=255779</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=255518</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adrian Perez">aperez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>zuesmewses</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2041704</commentid>
    <comment_count>0</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2024-06-17 11:51:57 -0700</bug_when>
    <thetext>After solving bug #255779 the initial values for WebKitSettings
properties which are backend by a feature flag are now in sync.
But an issue remains: changing a WebKitFeature does not trigger
the emission of the “notify” signal for the corresponding settings
property.

This can be seen in the following interactive Python session.
First, let&apos;s connect to the signal for one of the properties
and change it though the accessor:

&gt;&gt;&gt; from gi.repository import WebKit
&gt;&gt;&gt; settings = WebKit.Settings()
&gt;&gt;&gt; settings.connect(&quot;notify::enable-javascript&quot;, lambda *arg: print(&quot;Notify:&quot;, *arg))
16
&gt;&gt;&gt; settings.set_enable_javascript(False)
Notify: &lt;WebKit.Settings object at 0x7abc70dc3300 (WebKitSettings at 0x55c3bb6dfab0)&gt; &lt;GParamBoolean &apos;enable-javascript&apos;&gt;
&gt;&gt;&gt;

That worked as expected, the signal handler was called. Now, if
we retrieve the corresponding WebKitFeature and we try to toggle
it:

&gt;&gt;&gt; features = settings.get_all_features()
&gt;&gt;&gt; for i in range(features.get_length()):
...     feature = features.get(i)
...     if feature.get_identifier() == &quot;JavaScript&quot;:
...         break
...
&gt;&gt;&gt; feature
&lt;WebKit.Feature object at 0x7abc5c539010 (WebKitFeature at 0x7abc5d057cc0)&gt;
&gt;&gt;&gt; feature.get_identifier()
&apos;JavaScript&apos;
&gt;&gt;&gt; settings.set_feature_enabled(feature, True)
&gt;&gt;&gt;

This time the signal handler was NOT called, but the value of the
property did, indeed, change:

&gt;&gt;&gt; settings.get_enable_javascript()
True
&gt;&gt;&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>