fixup: Enable viewport <meta> tag support for mobile platforms only (#39207)

1. Adds a pref viewport_meta_enabled.
2. Enable pref for mobile platforms.

Testing: Tested Manually
Fixes: #39157
Fixes: #39002

---------

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
This commit is contained in:
Shubham Gupta 2025-09-12 01:21:04 +08:00 committed by GitHub
parent e6d46fb9f3
commit dfdcba88d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 6 deletions

View file

@ -51,7 +51,7 @@ pub fn init(
let mut args = mem::take(&mut init_opts.args);
args.insert(0, "servo".to_string());
let (opts, preferences, servoshell_preferences) = match parse_command_line_arguments(args) {
let (opts, mut preferences, servoshell_preferences) = match parse_command_line_arguments(args) {
ArgumentParsingResult::ContentProcess(..) => {
unreachable!("Android does not have support for multiprocess yet.")
},
@ -64,6 +64,8 @@ pub fn init(
ArgumentParsingResult::ErrorParsing => std::process::exit(1),
};
preferences.set_value("viewport_meta_enabled", servo::PrefValue::Bool(true));
crate::init_tracing(servoshell_preferences.tracing_filter.as_deref());
let (display_handle, window_handle) = unsafe {

View file

@ -146,7 +146,7 @@ pub fn init(
});
}
let (opts, preferences, servoshell_preferences) = match parse_command_line_arguments(args) {
let (opts, mut preferences, servoshell_preferences) = match parse_command_line_arguments(args) {
ArgumentParsingResult::ContentProcess(..) => {
unreachable!("OHOS does not have support for multiprocess yet.")
},
@ -157,6 +157,10 @@ pub fn init(
ArgumentParsingResult::ErrorParsing => std::process::exit(1),
};
if native_values.device_type == ohos_deviceinfo::OhosDeviceType::Phone {
preferences.set_value("viewport_meta_enabled", servo::PrefValue::Bool(true));
}
if servoshell_preferences.log_to_file {
let mut servo_log = PathBuf::from(&native_values.cache_dir);
servo_log.push("servo.log");