Bug 255779
Summary: | [GLib] Some default values for WebKitSettings properties do not match UnifiedWebPreferences.yaml | ||
---|---|---|---|
Product: | WebKit | Reporter: | Adrian Perez <aperez> |
Component: | WebKit API | Assignee: | Philippe Normand <philn> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | bugs-noreply, cgarcia, commit-queue, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=255518 https://bugs.webkit.org/show_bug.cgi?id=275577 |
||
Bug Depends on: | 275776 | ||
Bug Blocks: |
Adrian Perez
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Adrian Perez
I will do this as a follow-up after bug #255518 =)
Adrian Perez
Pull request: https://github.com/WebKit/WebKit/pull/29895
EWS
Committed 280080@main (4ad8749ae961): <https://commits.webkit.org/280080@main>
Reviewed commits have been landed. Closing PR #29895 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/130018124>
WebKit Commit Bot
Re-opened since this is blocked by bug 275776
Philippe Normand
Pull request: https://github.com/WebKit/WebKit/pull/30262
EWS
Committed 280453@main (ff6ffc06d5f8): <https://commits.webkit.org/280453@main>
Reviewed commits have been landed. Closing PR #30262 and removing active labels.