[Webkit-unassigned] [Bug 275577] New: [WPE][GTK] Toggling a WebKitFeature should notify WebKitSettings properties

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 17 11:51:57 PDT 2024


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

            Bug ID: 275577
           Summary: [WPE][GTK] Toggling a WebKitFeature should notify
                    WebKitSettings properties
           Product: WebKit
           Version: WebKit Local 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

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's connect to the signal for one of the properties
and change it though the accessor:

>>> from gi.repository import WebKit
>>> settings = WebKit.Settings()
>>> settings.connect("notify::enable-javascript", lambda *arg: print("Notify:", *arg))
16
>>> settings.set_enable_javascript(False)
Notify: <WebKit.Settings object at 0x7abc70dc3300 (WebKitSettings at 0x55c3bb6dfab0)> <GParamBoolean 'enable-javascript'>
>>>

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

>>> features = settings.get_all_features()
>>> for i in range(features.get_length()):
...     feature = features.get(i)
...     if feature.get_identifier() == "JavaScript":
...         break
...
>>> feature
<WebKit.Feature object at 0x7abc5c539010 (WebKitFeature at 0x7abc5d057cc0)>
>>> feature.get_identifier()
'JavaScript'
>>> settings.set_feature_enabled(feature, True)
>>>

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

>>> settings.get_enable_javascript()
True
>>>

-- 
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/20240617/593d814b/attachment.htm>


More information about the webkit-unassigned mailing list