Bug 275577
Summary: | [WPE][GTK] Toggling a WebKitFeature should notify WebKitSettings properties | ||
---|---|---|---|
Product: | WebKit | Reporter: | Adrian Perez <aperez> |
Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | zuesmewses |
Priority: | P2 | ||
Version: | WebKit Local Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=255779 https://bugs.webkit.org/show_bug.cgi?id=255518 |
Adrian Perez
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
>>>
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |