Add --enable-experimental-web-platform-features command line (#36022)

This command line argument will enable a set of web platform features
that are under development but not ready to be enabled by default.

Signed-off-by: Manuel Rego Casasnovas <rego@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Manuel Rego 2025-03-19 13:18:36 +01:00 committed by GitHub
parent 86341da885
commit 8f79b77c13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -347,6 +347,11 @@ pub(crate) fn parse_command_line_arguments(args: Vec<String>) -> ArgumentParsing
"FILTER",
);
opts.optflag(
"",
"enable-experimental-web-platform-features",
"Whether or not to enable experimental web platform features.",
);
opts.optmulti(
"",
"pref",
@ -540,6 +545,30 @@ pub(crate) fn parse_command_line_arguments(args: Vec<String>) -> ArgumentParsing
})
.collect();
if opt_match.opt_present("enable-experimental-web-platform-features") {
vec![
"dom_fontface_enabled",
"dom_imagebitmap_enabled",
"dom_intersection_observer_enabled",
"dom_mouse_event_which_enabled",
"dom_notification_enabled",
"dom_offscreen_canvas_enabled",
"dom_permissions_enabled",
"dom_resize_observer_enabled",
"dom_serviceworker_enabled",
"dom_svg_enabled",
"dom_webgl2_enabled",
"dom_webgpu_enabled",
"dom_xpath_enabled",
"layout_columns_enabled",
"layout_container_queries_enabled",
"layout_grid_enabled",
"layout_writing_mode_enabled",
]
.iter()
.for_each(|pref| preferences.set_value(pref, PrefValue::Bool(true)));
}
// Handle all command-line preferences overrides.
for pref in opt_match.opt_strs("pref") {
let split: Vec<&str> = pref.splitn(2, '=').collect();